|
ShowWindow(SW_HIDE) will hide the window and in my case , make the windows of other applications to the foreground and activate them. How can I restore it programatically when my application is not having focus.. Does my application have to be a service..in which case any short cut key will make it active again?
row
|
|
|
|
|
ROWALI wrote: How can I restore it programatically when my application is not having focus
You need a handle or a pointer on your window, and then use ShowWindow(SW_SHOW).
BUT the question is : what is the reason for your window to be showed again ? According to the answer, you'll find the method to bring the window back (e.g. do it from another app -- a hook, or from within your app).
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
Just an idea...
You could always use RegisterHotKey() and set a hotkey activation. Then in your dialog, you would need to handle the WM_HOTKEY message, and do ShowWindow(SW_SHOW) and make your dialog visible again.
or
You could add a system tray icon, and have the user click the tray icon to show the dialog again.
I would suggest searching codeproject, there are many samples of both.
-Randor
|
|
|
|
|
After you ShowWindow(SW_NORMAL) Use SetWindowPos with HWND_NOTOPMOST for the "insert after" parameter.
byebye..
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
|
|
|
|
|
|
If I want to send some text,which includes some char terminator,'\0',Which is the better way to calculate the len of the buffer.
send(conn,buff,strlen(buff),0)
I think It is not right to use strlen.It will terminate at first \0,if the buff like {'a',0x0002,'buff').Should I replace strlen(buff) with 7,which is the exact length of text I want send.
|
|
|
|
|
strlen is OK
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
No, strlen(buff) will omit the NULL terminator. The poster clearly defined that he wanted to send the NULL in the tcp packet.
|
|
|
|
|
I mean strlen function is OK for this case.
Yaa , you are right.if at all, u want to send all the characters including NULL u need to pass strlen(buff) + 1 ;
Check this sample:
<br />
#include <stdio.h><br />
#include <string.h><br />
<br />
int main ()<br />
{<br />
char szInput[256];<br />
printf ("Enter a sentence: ");<br />
gets (szInput);<br />
printf ("Sentence entered is %u characters long\n",strlen(szInput));<br />
return 0;<br />
}<br />
<br />
Output:<br />
Enter sentence: just testing<br />
Sentence entered is 12 characters long
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
if char buff[]={'a','b',0x00,'c','d','e',0x02,0x03,0x00,'g'}
strlen(buff)+1=3
but I need to send 10 char.So I think strlen is not right in this case.
|
|
|
|
|
strlen(buff) +1;
That will include the NULL character.
|
|
|
|
|
If your buffer is initialized at declaration, like this:
char buffer[] = {'a', 'b', 0x00, 'c', 'd', 0};
then you can use sizeof(buffer) expression to count the size.
Otherwise, if the buffer is built dynamically, I think you have to have a counter of values added to buffer. After each addition, update that counter. Then use it before sending.
It is easier to work with dynamic arrays using std::vector class from STL.
If your problem is caused by Unicode strings that may contain null bytes, then instead of strlen function use wcslen and then multiply the result with two before sending.
|
|
|
|
|
send me as early as possible
#sankar#
|
|
|
|
|
sankarRao wrote: send me as early as possible
Be polite while asking Questions my dear friend.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
plz send me as early as possible
#sankar#
|
|
|
|
|
|
thanque and sorry
#sankar#
|
|
|
|
|
|
|
We know how to take window to foreground (SetForegroundWindow())
But how can I push the window to background and let the window which is under our application's window cover our application window?
Row
|
|
|
|
|
If you known wich window is under your window, that call SetForegroundWindow for that window.
Otherwise, may be minimizing your window with ShowWindow(SW_MINIMIZE) is satisfactory?
|
|
|
|
|
ROWALI wrote: We know how to take window to foreground (SetForegroundWindow())
But how can I push the window to background and let the window which is under our application's window cover our application window?
use SetWindowPos with wndTop for the background window.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hello
An idea is to use EnumWindows() to enumerate all top level windows, then push them all forward.
|
|
|
|
|
exactly.
-- modified at 8:37 Monday 19th June, 2006
Sorry I checked .. No use
|
|
|
|
|
Why would you want to do this? If I am typing in some program and all of a sudden the windows started changing their z-order, that's not going to make me very happy.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|