Hi All,
I have a DllCaller and a Dialog Dll, when the DllCaller module loads the dialog from the dll, I want to let the dialog itself to get the current process handle and set it as its process handle to implement a Modal dialog(but I don't want to pass in the DllCaller process handle), how can I do it? could you give me some suggestions? thanks in advance.
thanks
James
How to get the current process handle Topic is solved
-
- Knows some wx things
- Posts: 38
- Joined: Wed Aug 02, 2006 4:59 am
Hi!
I suppose you mean the window handle of the main window, not the process handle.
The most simple way would be to use FindWindow() and pass it the class name of the main window if you know it and its title. The resulting HWND could be use to create a dialog modal to it.
Another option would be enumerating all windows of the process and trying to determine the main window that way.
I suppose you mean the window handle of the main window, not the process handle.
The most simple way would be to use FindWindow() and pass it the class name of the main window if you know it and its title. The resulting HWND could be use to create a dialog modal to it.
Another option would be enumerating all windows of the process and trying to determine the main window that way.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
-
- Knows some wx things
- Posts: 38
- Joined: Wed Aug 02, 2006 4:59 am
-
- Knows some wx things
- Posts: 38
- Joined: Wed Aug 02, 2006 4:59 am