Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussions

GetWindowInfo function not recognized

cartman4
Beginner
1,068 Views

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

0 Kudos
1 Solution
Steven_L_Intel1
Employee
1,068 Views

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.

View solution in original post

0 Kudos
3 Replies
cartman4
Beginner
1,068 Views
OK, I think I figured it out. It looks like GetWidowInfo is only available in 64-bit system builds. Any idea why that is?
0 Kudos
anthonyrichards
New Contributor III
1,068 Views

Add USE IFWINTY to your procedure. That is where the T_GETWINDOWINFO type is defined.

0 Kudos
Steven_L_Intel1
Employee
1,069 Views

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.

0 Kudos
Reply