|
Hi to all,
How to make the application hidden in task pane. I wanted something like GTalk. when I minimize it it should be running. I can maximize it from task pane. But it is not visible in the Task Bar.
Thanks in Advance
I am a beginner
|
|
|
|
|
The ShowWindow() call will do the job. -> SW_MINIMIZE
Greetings from Germany
|
|
|
|
|
you should use Shell_Notify() function to Show the icon in quick start bar and use ShowWindow(hWnd,SW_HIDE) to hide the minimum icon in tool bar.
|
|
|
|
|
Hopefully [^] will help you. The article minimised the program, without showing a program on the program list (can't think of the proper name) in the shell - but you can restore it by using the Notify Area / System tray.
Read the article - I'm doing a terrible job of summarising.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Hi,
I would like to find out which window is active (e.g. in taskbar we have several applications are running ADOBE, Winword, Excel.... and I am working on winword). I would like to know how to get the current application name or file name (e.g. test.doc). Pls suggest.
Thanks
SNI
|
|
|
|
|
You can use of EnumWindows for enumerates all windows and then you can use of IsWindowEnabled,Is it enable window or no.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
thanks for this.
Can you help me to find out file names (e.g. Two excel files are open Book1.xls and Book2.xls). How to get the name of file which is having focus.
Thanks
SNI
|
|
|
|
|
HWND hWnd=GetActiveWindow();
char *s;
GetWindowText(hWnd,s);
Then compare s and file name to get focus window.
strcmp(s,filename);
|
|
|
|
|
char Buffer[100];
HWND hwnd=::GetForegroundWindow() ;
::GetWindowText(hwnd,Buffer,sizeof(Buffer));
a beginner
|
|
|
|
|
Do I need to use it?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
sWindowEnabled only check if this window can recive the keyboard and mouse event ,there are many windows can do this ,you canan't find the right window you need
a beginner
|
|
|
|
|
I have to construct a class for strings. C++ already has one, but my assignment is a home-made version. I am very lost as to how to make the constructor work. I have toyed with a few things, but I was given a header file to follow and I have no clue what to do. Any help would be appreciated.
class String
{
private:
unsigned Capacity;
unsigned Length;
char * Mem;
public:
String()
{
Mem = NULL;
Capacity = 0;
Length = 0;
}
A few specific questions I have:
How are the Mem, Capacity, and Length relavent? After reading the assignment but before looking at the header file I thought i was going to construct a string by taking the sizeof() of the string then applying an array of char[].
I do not see the point of reserving memory for a string when you already know how much space to save...In simpler words I see no point in having a Capacity and a length?
|
|
|
|
|
aab19902 wrote: I do not see the point of reserving memory for a string when you already know how much space to save...In simpler words I see no point in having a Capacity and a length?
If you have a static string, then there's no point in it. But suppose that you want to add characters, or remove characters from your existing string, then for each character that you add or remove, you do not want to resize your string. Thus, if you remove some characters, you keep the array size the same (capacity) but your length decreases.
|
|
|
|
|
there is no sense in n having a Capacity and a length. But take care in implementing string operations, than you have to create a changed value, often with another length.
PS: I hope this is for learning purposes, and you dont wont reinvent the proven CString or std::string classes
Greetings from Germany
|
|
|
|
|
aab19902 wrote: I do not see the point of reserving memory for a string when you already know how much space to save...In simpler words I see no point in having a Capacity and a length?
Consider:
String s;
for (int x = 0; x < 100; x++)
s += "A"; This will re/allocate memory 100 times within your String class -- very inefficient. Assuming that strings have an average or a minimun length, you could allocate 50 bytes up front, and then not have to allocate any more until you are close to consuming all of that. In that case, Capacity would be 50 while Length would be 0 .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi friends,
I am write a software using VC++ which is having USB interface to Digital Readout System. I am use our own USB driver. I am use Microsoft Visual Studio 2008 and my operating system is Windows XP. my software working ok means it read data from DRO and Write data to DRO. But when i install my software on Windows Vista software run but when i try to read or write data to DRO it shows USB device not connected. But if i see in Device manager USB devices it show my device is detected.
I wan't to know what is problem? Is any setting required to do to at compile time of project to work it with Vista. or I need to do my project compile on Vista operating system.
Thank You,
Somnath Jagtap
|
|
|
|
|
In vista 32 or 64?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
|
Somewhere in your data chain you havent the access rights for the USB-Device. Run your app as admin!
For the future you should use the right API for communicating with the USB-Drive. => File-API
Greetings from Germany
|
|
|
|
|
I have defined first GUID and handles, then using Readfile and Writefile for data read and write on USB. as shown below
GUID *guidDev = (GUID*) &GUID_CLASS_USBPORT;
HDEVINFO hDevInfo = INVALID_HANDLE_VALUE;
hDevInfo = SetupDiGetClassDevs( guidDev,
NULL,
NULL,
DIGCF_PRESENT | DIGCF_DEVICEINTERFACE
);
g_hw_USBWrite = CreateFile ( UsbWritePipe,
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, // no SECURITY_ATTRIBUTES structure
OPEN_EXISTING, // No special create flags
0, // No special attributes
NULL); // No template file
g_hw_USBRead = CreateFile ( UsbReadPipe,
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, // no SECURITY_ATTRIBUTES structure
OPEN_EXISTING, // No special create flags
0, // No special attributes
NULL); // No template file
These are some decleratios i do for access USB if something is wrong in it please tell me.
And if my API are wrong then how it work fine for Windows XP?
Waiting for reply?
thank you
|
|
|
|
|
You arent doing wrong BUT Microsoft had changed access right / managment in Vista. So check every call what can be wrong. -> Read the fine manuals online.
For instance in: g_hw_USBRead = CreateFile ( UsbReadPipe,
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
Check every parameter / flag: in reading you dont NEED write rights. Is UsbReadPipe vaild?
That is all yor work.
Greetings from Germany
|
|
|
|
|
I have a excel file . I want to import in my gui application . my excel file cell has reference of other application . how can I import that data to my gui application
Trioum
|
|
|
|
|
Google for excell automation. This is a quite broad subject thought...
|
|
|
|
|
can you help me in this scenerio . some quick api . I want to connect excel file with by gui .
also that excel file is updating continously from some other application and cell is updation the value with some formulae
Trioum
|
|
|
|
|