- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can anyone tell me why I'm getting the following error when I try to use the GetWindowInfo function (defined in user32) in a test program.
error #6404: This name does not have a type, and must have an explicit type. [GETWINDOWINFO]
Here's the function where I'm trying to use it. (This is just the MainWndProc generated by the Windows SDI template.) My call to GetWindowInfo is near the bottom.
integer(LRESULT) function MainWndProc ( hWnd, mesg, wParam, lParam )
!DEC$ IF DEFINED(_X86_)
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_MainWndProc@16' :: MainWndProc
!DEC$ ELSE
!DEC$ ATTRIBUTES STDCALL, ALIAS : 'MainWndProc' :: MainWndProc
!DEC$ ENDIF
use user32
use WinTestAppGlobals
implicit none
integer(HANDLE) hWnd
integer(UINT) mesg
integer(UINT_PTR) wParam
integer(LONG_PTR) lParam
include 'resource.fd'
interface
function AboutDlgProc( hwnd, mesg, wParam, lParam )
!DEC$ IF DEFINED(_X86_)
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_AboutDlgProc@16' :: AboutDlgProc
!DEC$ ELSE
!DEC$ ATTRIBUTES STDCALL, ALIAS : 'AboutDlgProc' :: AboutDlgProc
!DEC$ ENDIF
use ifwinty
integer(LRESULT) :: AboutDlgProc ! LRESULT
integer(HANDLE) hwnd
integer(UINT) mesg
integer(UINT_PTR) wParam
integer(LONG_PTR) lParam
end function
end interface
! Variables
integer(BOOL) lret
integer(LRESULT) ret
character(SIZEOFAPPNAME) lpszName, lpszHelpFileName, lpszContents, lpszMessage
character(SIZEOFAPPNAME) lpszHeader
integer(BOOL) bret
TYPE (T_WINDOWINFO) pwi
select case ( mesg )
! WM_DESTROY: PostQuitMessage() is called
case (WM_DESTROY)
call PostQuitMessage( 0 )
MainWndProc = 0
return
! WM_COMMAND: user command
case (WM_COMMAND)
select case ( IAND(wParam, 16#ffff ) )
case (IDM_EXIT)
ret = SendMessage( hWnd, WM_CLOSE, 0, 0 )
MainWndProc = 0
return
case (IDM_ABOUT)
lpszName = "AboutDlg"C
ret = DialogBoxParam(ghInstance,LOC(lpszName),hWnd,&
LOC(AboutDlgProc), 0_LONG_PTR)
MainWndProc = 0
return
case (IDM_HELPCONTENTS)
lpszHelpFileName ="\\\\WinTestApp.hlp"C
lpszContents = "CONTENTS"C
if (WinHelp (hWnd, lpszHelpFileName, HELP_KEY, &
LOC(lpszContents)) .EQV. FALSE) then
lpszMessage = "Unable to activate help"C
lpszHeader = "WinTestApp"
ret = MessageBox (hWnd, &
lpszMessage, &
lpszHeader, &
IOR(MB_SYSTEMMODAL, &
IOR(MB_OK, MB_ICONHAND)))
end if
MainWndProc = 0
return
case (IDM_HELPSEARCH)
lpszHelpFileName ="\\\\WinTestApp.hlp"C
lpszContents = "CONTENTS"C
if (WinHelp(hWnd, "WinTestApp.hlp"C, &
HELP_PARTIALKEY, LOC(""C)) .EQV. FALSE) then
lpszMessage = "Unable to activate help"C
lpszHeader = "WinTestApp"C
ret = MessageBox (hWnd, &
lpszMessage, &
lpszHeader, &
IOR(MB_SYSTEMMODAL , &
IOR(MB_OK, MB_ICONHAND)))
end if
MainWndProc = 0
return
case (IDM_HELPHELP)
if (WinHelp(hWnd, ""C, HELP_HELPONHELP, 0).EQV. FALSE)&
then
lpszMessage = "Unable to activate help"C
lpszHeader = "WinTestApp"C
ret = MessageBox (GetFocus(), &
lpszMessage, &
lpszHeader, &
IOR(MB_SYSTEMMODAL,IOR(MB_OK, MB_ICONHAND)))
end if
MainWndProc = 0
return
! All of the other possible menu options are currently disabled
case DEFAULT
MainWndProc = DefWindowProc( hWnd, mesg, wParam, lParam )
return
end select
case (WM_LBUTTONUP)
bret = GetWindowInfo(hWnd, pwi)
return
! Let the default window proc handle all other messages
case default
MainWndProc = DefWindowProc( hWnd, mesg, wParam, lParam )
end select
end
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For some odd reason, the source for USER32 has a conditional over that part of it that is for x64 only. This is a mistake. It seems to have been that way for a long while - we'll fix it. Thanks for bringing it to our attention.
Use the attached revised version - just add it to your project.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Add USE IFWINTY to your procedure. That is where the T_GETWINDOWINFO type is defined.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For some odd reason, the source for USER32 has a conditional over that part of it that is for x64 only. This is a mistake. It seems to have been that way for a long while - we'll fix it. Thanks for bringing it to our attention.
Use the attached revised version - just add it to your project.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page