Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28991 Discussions

How to get window handle of main dialog box

Gerald_F_
Beginner
1,033 Views

I am writing QuickWin console application and cannot figure out how to get the window handle of my main (modeless) dialog box (which I call IDD_DIALOG1).  I know how the get the handle for dialog controls (e.g. hWnd=GetWindowItem(dlg%hWnd,IDC_CONTROL)), but not for the main window.

I want this handle for when I launch a pop-up modal dialog box (from the main program - not from a callback routine), using reti=dlgmodalwithparent(dlg2,hWndParent), where hWndParent is the handle to my main dialog box.  I want to do this so my main dialog box will be disabled while the new dialog is displayed.

Any help will be appreciated.

0 Kudos
2 Replies
andrew_4619
Honored Contributor III
1,033 Views

GETHWNDQQ (W*S)

QuickWin Function: Converts a window unit number into a Windows* handle.

Module

USE IFQWIN

result = GETHWNDQQ (unit)

unit

(Input) INTEGER(4). The window unit number. If unit is set to QWIN$FRAMEWINDOW (defined in IFQWIN.F90), the handle of the frame window is returned.

Results

The result type is INTEGER(4) on IA-32 architecture; INTEGER(8) on Intel® 64 architecture. The result is a true Windows handle to the window. If unit is not open, it returns -1 .

0 Kudos
Gerald_F_
Beginner
1,033 Views

Thanks, App4619.

And thanks for setting me straight on getting the main dialog handle for a Console Application (the handle is simply dlg%hWnd, where dlg refers to the main dialog.  Then use reti=dlgmodalwithparent(dlg2,dlg%hWnd) when launching the child dialog).

Everything is working great, now.

0 Kudos
Reply