<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Display drop-down menu from within program in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Display-drop-down-menu-from-within-program/m-p/973186#M24482</link>
    <description>See &lt;A href="http://www7.compaq.com/forum?14@@.eeffb2a!SearchMark=1#1"&gt;my reply&lt;/A&gt; regarding the interface block.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
    <pubDate>Fri, 16 Nov 2001 03:03:14 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2001-11-16T03:03:14Z</dc:date>
    <item>
      <title>Display drop-down menu from within program</title>
      <link>https://community.intel.com/t5/Software-Archive/Display-drop-down-menu-from-within-program/m-p/973177#M24473</link>
      <description>What message can I send to a window from within the program &lt;BR /&gt; to display a drop-down menu &lt;BR /&gt;as if I had selected an item from the menu bar using the mouse or a hot-key? &lt;BR /&gt;TIA</description>
      <pubDate>Fri, 09 Nov 2001 21:11:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Display-drop-down-menu-from-within-program/m-p/973177#M24473</guid>
      <dc:creator>isn-removed200637</dc:creator>
      <dc:date>2001-11-09T21:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: Display drop-down menu from within program</title>
      <link>https://community.intel.com/t5/Software-Archive/Display-drop-down-menu-from-within-program/m-p/973178#M24474</link>
      <description>There are two ways; the one you seem to be looking for (simulating user input) can be achieved using Win32 APIs keybd_event, mouse_event or SendInput. Another, pure "programatic" would be to use TrackPopupMenu, GetMenuItemRect and GetMenuItemInfo. &lt;BR /&gt; &lt;BR /&gt;Jugoslav</description>
      <pubDate>Mon, 12 Nov 2001 23:25:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Display-drop-down-menu-from-within-program/m-p/973178#M24474</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2001-11-12T23:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Display drop-down menu from within program</title>
      <link>https://community.intel.com/t5/Software-Archive/Display-drop-down-menu-from-within-program/m-p/973179#M24475</link>
      <description>Sorry, for 'in DFWINTY' ead 'in DFWIN'.  Meanwhile, I checked and GetMenuItemRect is in USER32.dll</description>
      <pubDate>Tue, 13 Nov 2001 19:47:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Display-drop-down-menu-from-within-program/m-p/973179#M24475</guid>
      <dc:creator>isn-removed200637</dc:creator>
      <dc:date>2001-11-13T19:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Display drop-down menu from within program</title>
      <link>https://community.intel.com/t5/Software-Archive/Display-drop-down-menu-from-within-program/m-p/973180#M24476</link>
      <description>Thanks. I have changed the function call to GetMenuItemRect(hWnd, hMenu , hItem, LOC(menrect), but what should the Interface block contain? At the moment I have the following:&lt;PRE&gt; 
	interface 
	logical(4) function  GetMenuItemRect(hWnd, hMenu , hItem, menrect)  
!DEC$ IF DEFINED(_X86_) 
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_GetMenuItemRect@16' :: GetMenuItemRect 
!DEC$ ELSE 
!DEC$ ATTRIBUTES STDCALL, ALIAS :  'GetMenuItemRect'   :: GetMenuItemRect 
!DEC$ ENDIF 
	use dfwinty 
	integer hWnd 
	integer hMenu 
	integer hitem 
	type(T_RECT) menrect 
	end function GetMenuItemRect 
	end interface 
&lt;/PRE&gt; &lt;BR /&gt;Where should the !DEC$ATTRIBUTES REFERENCE:: menRect. go?&lt;P&gt; &lt;BR /&gt;I still get unsatisfied external reference when I compile and link. &lt;BR /&gt;GetMenuItemRect is in USER32.dll (which is referenced by USER32.LIB)  &lt;BR /&gt;and that library is included in my link list. &lt;BR /&gt;&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;BTW, my last two posts to this thread have got lost, even though I got an e-mail &lt;BR /&gt;confirmation of each being accepted. There were some annoying problems with the message &lt;BR /&gt;board software on Tuesday which probably caused this.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2001 19:43:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Display-drop-down-menu-from-within-program/m-p/973180#M24476</guid>
      <dc:creator>isn-removed200637</dc:creator>
      <dc:date>2001-11-15T19:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: Display drop-down menu from within program</title>
      <link>https://community.intel.com/t5/Software-Archive/Display-drop-down-menu-from-within-program/m-p/973181#M24477</link>
      <description>!DEC$ATTRIBUTES REFERENCE should go anywhere within interface block.  &lt;BR /&gt;(preferrably next to TYPE(menRect):: Rect). See ...DFIncludeDFWIN.f90 for samples on how various argument combinations are translated. I believe link error is just a consequence of that.  &lt;BR /&gt; &lt;BR /&gt;Jugoslav</description>
      <pubDate>Thu, 15 Nov 2001 20:41:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Display-drop-down-menu-from-within-program/m-p/973181#M24477</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2001-11-15T20:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Display drop-down menu from within program</title>
      <link>https://community.intel.com/t5/Software-Archive/Display-drop-down-menu-from-within-program/m-p/973182#M24478</link>
      <description>Thanks Jugoslav.&lt;P&gt; I found the following works: the linker finds  the routine _getmenuitemrect@16. Note that I removed STDCALL from the first !DEC$ATTRIBUTES compiler directive, which I think otherwise adds a(nother?) leading underline to the alias:&lt;PRE&gt; 
	interface 
	logical(4) function  GetMenuItemRect(hWnd, hMenu , hItem, menrect)  
!DEC$ IF DEFINED(_X86_) 
!DEC$ ATTRIBUTES ALIAS : '_GetMenuItemRect@16' :: GetMenuItemRect 
!DEC$ ATTRIBUTES REFERENCE :: menrect 
!DEC$ ELSE 
!DEC$ ATTRIBUTES STDCALL, ALIAS :  'GetMenuItemRect'   :: GetMenuItemRect 
!DEC$ ATTRIBUTES REFERENCE :: menrect 
!DEC$ ENDIF 
	use dfwinty 
	integer hWnd 
	integer hMenu 
	integer hitem 
	type (T_RECT) menrect 
C	integer menrect 
	end function GetMenuItemRect 
	end interface 
C FLAGS REQUIRED BY TRACKPOPUPMENU (Taken from WINUSER.H) 
C THAT ARE NOT IN DFWINTY.F90 
	integer, parameter:: TPM_TOPALIGN        =#0000 
	integer, parameter:: TPM_VCENTERALIGN    =#0010 
	integer, parameter:: TPM_BOTTOMALIGN     =#0020 
	integer, parameter:: TPM_HORIZONTAL      =#0000      
	integer, parameter:: TPM_VERTICAL        =#0040      
	integer, parameter:: TPM_NONOTIFY        =#0080      
	integer, parameter:: TPM_RETURNCMD       =#0100&lt;/PRE&gt; &lt;BR /&gt;However, when I call GETMENUITEMRECT, it returns zero (and the RECT structure menrect contains all zeros) and GETLASTERROR gives error code = 1400, which &lt;BR /&gt;shows that it failed because of an invalid window handle. I do not understand this, because I used the same window handle as I used to get the handle to the pop-up menu that I display. I even tried using the handle returned by GETACTIVEWINDOW(), but with the same failure. &lt;/P&gt;&lt;P&gt; &lt;BR /&gt;TRACKPOPUPMENU works ok though and I can display the drop-down menu that I want, but I cannot display it in its usual relationship to the window's menu because of the failure to get the co-ordinates for the menuitem which normally activates the drop-down menu. Sigh.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2001 21:49:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Display-drop-down-menu-from-within-program/m-p/973182#M24478</guid>
      <dc:creator>isn-removed200637</dc:creator>
      <dc:date>2001-11-15T21:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Display drop-down menu from within program</title>
      <link>https://community.intel.com/t5/Software-Archive/Display-drop-down-menu-from-within-program/m-p/973183#M24479</link>
      <description>hWnd should be the handle of frame window (or the window that contains the main menu). However, I find &lt;B&gt;very&lt;/B&gt; odd that the interface block without STDCALL works. I tried it on my 5.0D, and your first version with only REFERENCE added works fine. The way you declared it now hWnd, hMenu and iItem arguments will be passed by reference instead of by value and you'll surely get an error like that (the linking will pass fine, but the API will get wrong numbers at run-time).  (STDCALL attribute introduces call-by-value as default).  &lt;BR /&gt; &lt;BR /&gt;Jugoslav</description>
      <pubDate>Thu, 15 Nov 2001 22:54:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Display-drop-down-menu-from-within-program/m-p/973183#M24479</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2001-11-15T22:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Display drop-down menu from within program</title>
      <link>https://community.intel.com/t5/Software-Archive/Display-drop-down-menu-from-within-program/m-p/973184#M24480</link>
      <description>OK jugoslav, I get the point..so I went back to this...&lt;PRE&gt; 
	interface 
	logical(4) function  GetMenuItemRect(hWnd, hMenu , hItem, menrect)  
cDEC$ ATTRIBUTES STDCALL, ALIAS : '_GetMenuItemRect@16' :: GetMenuItemRect 
cDEC$ ATTRIBUTES REFERENCE :: menrect 
	use dfwinty 
	integer hWnd 
	integer hMenu 
	integer hitem 
	type (T_RECT) menrect 
	end function GetMenuItemRect 
	end interface 
&lt;/PRE&gt; &lt;BR /&gt;and used the following call&lt;P&gt; &lt;BR /&gt;	RETLOG=GetMenuItemRect(ghWnd,hMenu,2, dropdrect )&amp;lt; p&amp;gt; &lt;BR /&gt;The routine compiled ok (with dropdrect defined as TYPE (T_RECT) ), but I am still getting the link error&lt;PRE&gt; 
OPENFILE.OBJ : error LNK2001: unresolved external symbol _GETMENUITEMRECT@16 
Release/generic.exe : fatal error LNK1120: 1 unresolved externals 
&lt;/PRE&gt; &lt;BR /&gt;With the above interface block, the alias '_GetMenuItemRect@16' should ensure that the required routine is recognised. I know that TrackPopUpMenu has exactly similar interface(but with 7 arguments, hence @28 is appended to the alias '_TrackPopUpMenu' ) and it is found and linked ok and I know that both routines are &lt;BR /&gt;in USER32.DLL. It is frustrating that the linker is still refusing to find GetMenuItemRect !! &lt;BR /&gt;I give up! &lt;BR /&gt;regards &lt;BR /&gt;tony richards&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2001 00:36:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Display-drop-down-menu-from-within-program/m-p/973184#M24480</guid>
      <dc:creator>isn-removed200637</dc:creator>
      <dc:date>2001-11-16T00:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: Display drop-down menu from within program</title>
      <link>https://community.intel.com/t5/Software-Archive/Display-drop-down-menu-from-within-program/m-p/973185#M24481</link>
      <description>Heck, Tony, I've got a feeling that you're doing something terribly wrong, but I can't figure out what. The linker error suggests that the caller doesn't see ALIAS. &lt;BR /&gt;Where are you trying to put that INTERFACE in? If in ...DFWIN.f90, that won't work, because it's dfwin.mod file that matters, and it's not recompiled. You should put it in your calling code. Alternatively, you could also edit and &lt;B&gt;recompile&lt;/B&gt; dfwin.f90, but you should copy dfwin.mod to ...DFInclude. (But I don't recommend that, since I did it once and had pains when upgrading and moving code to other machines). &lt;BR /&gt; &lt;BR /&gt;If I'm wrong, I guess I'll give up too :-).</description>
      <pubDate>Fri, 16 Nov 2001 01:10:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Display-drop-down-menu-from-within-program/m-p/973185#M24481</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2001-11-16T01:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Display drop-down menu from within program</title>
      <link>https://community.intel.com/t5/Software-Archive/Display-drop-down-menu-from-within-program/m-p/973186#M24482</link>
      <description>See &lt;A href="http://www7.compaq.com/forum?14@@.eeffb2a!SearchMark=1#1"&gt;my reply&lt;/A&gt; regarding the interface block.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Fri, 16 Nov 2001 03:03:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Display-drop-down-menu-from-within-program/m-p/973186#M24482</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2001-11-16T03:03:14Z</dc:date>
    </item>
  </channel>
</rss>

