|
-
April 20th, 2004, 09:15 AM
#1
strange... SetWindowPos
This window is created when is executed an application that i launch in my code with shellexecute...
HINSTANCE hHaptek;
HWND wHaptek;
HWND wHaptekC;
hHaptek= ShellExecute(NULL, "open","haptek.exe","", "c:\\",SW_SHOW);
Sleep(3000);
wHaptek= FindWindow("ThunderRT6Main", "Wrapper Haptek");
if (wHaptek!=NULL)
MessageBox(wHaptek,"Esiste","on",MB_OK);
wHaptekC=SetParent(wHaptek,hWndP); //is child of another window
if (wHaptekC!=NULL)
MessageBox(wHaptek,"EsisteFiglio","on",MB_OK);
Sleep(2000);
ShowWindow(wHaptekC,SW_MAXIMIZE);
The handle exist but...
I try function SetWindowPos, ShowWindow, SetWindowText and no one work.
Excuse me for my bad english........... ..... I'm italian!
Help me!
-
April 20th, 2004, 12:46 PM
#2
What are you trying to do ?
Can you give one example of how you call the function and what you expect to happen because of that ?
-
April 21st, 2004, 01:01 AM
#3
ShellExecute(NULL, "open","haptek.exe","", "c:\\",SW_SHOW);
wHaptek= FindWindow("ThunderRT6Main", "Wrapper Haptek");
ShowWindow(wHaptek,SW_MAXIMIZE);
The window isn't SW_MAXIMIZE.... Why?
THANKS
Last edited by Nikon82; April 21st, 2004 at 01:06 AM.
-
April 21st, 2004, 07:56 AM
#4
Probably because wHaptek isn't a handle to the correct window.
When you do ShellExecute, the haptek.exe process is started in the background. ShellExecute return immediately. So, if you immediately call FindWindow, you won't find the window because it isn't created yet.
Check if wHaptek contains the handle to the correct window.
-
April 21st, 2004, 08:31 AM
#5
Yes... i have yet thought it... in my code there is spleep(2000)... read the previous post...
however thanks...
help me...
-
April 21st, 2004, 08:59 AM
#6
Does the maximizing stuff works when you leave out the line SetParent(wHaptek,hWndP)?
-
April 22nd, 2004, 01:54 AM
#7
GREAT GREAT GREAT
THANKS A LOT...
the problem is there
wHaptekC=SetParent(wHaptek,hWndP);
i must use e.g.
SetWindowText(wHaptek) and NOT SetWindowText(wHaptekC)
I don't understand... Why?
YOU ARE GREAT!!!!!!!!!!!!!!!!!!!!!!!!
-
April 22nd, 2004, 07:45 AM
#8
wHaptekC is the old parent of wHaptek.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|