Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MsgBox ? "how to insure that it is on same monitor as"
#1
Gintaras,

I have message boxes that 'pop-up' to reveal information about items in a ListBox. Is there a way to insure that this ALWAYS pops up on the same monitor as the ListBox? I mean, can you make this a 'child' of the listbox?

Thanks!
#2
Macro Macro2713
Code:
Copy      Help
MES m.hwndowner=listBoxWindowHandle
mes "" "" m
#3
If I've assigned the name of the listbox to the variable 'listBoxSysTitle', would this be correct?

MES m.hwndowner=F"{listBoxSysTitle}"
m.style=F"{MSGforHotKey_StyleButtons}n"
m.x=175 ;;160329 from 10
m.y=400
m.timeout=15
m.default='C'
int i=mes("" ""m)
#4
MES m.hwndowner=win("listBoxSysTitle"); if(m.hwndowner=0) end ERR_WINDOW
#5
Are you saying that QM knows that

"listBoxSysTitle"

in "MES m.hwndowner=win("listBoxSysTitle")"

is a a variable?
#6
Sorry, must be without "" if variable.

MES m.hwndowner=win(listBoxSysTitle); if(m.hwndowner=0) end ERR_WINDOW
#7
OK Gintaras, I've added that but I now have a problem. (Windows 10) When the message appears the listbox disappears from the monitor?
#8
Please post the code to test.
#9
I see how to capture the code from QM but HOW DO I paste it here?
#10
In QM: menu Edit -> Other formats -> Copy for QM forum.
In Firefox: Ctrl+V. Don't use the Code button, it is for languages other than QM.
#11
Function Oc_LBX_24k_8item_S_Hotkey_MSG
Code:
Copy      Help
;BUILD_ID_150318_14_14

str message="Longer Descriptive message for (S) hotkey"
;;;the above line for testing only, NOTE this will be set at some other point

wait 0.1 ;;160328 from 0.33

int w=win(F"{listBoxSysTitle}" "#32770")
wait 0.01
ifa(w)
,;;MES m
,MES m.hwndowner=F"{listBoxSysTitle}" ;;this makes this a child of the named ListBox
,;out listBoxSysTitle ;;for testing only
,;;MES m.hwndowner=win(listBoxSysTitle); if(m.hwndowner=0) end ERR_WINDOW
,m.style=F"{MSGforHotKey_StyleButtons}n"
,m.x=440 ;;160329 from 10
,m.y=322
,m.timeout=15
,m.default='C'
,int i=mes(F"{MSGforHotKey_TextLine1Item1}{MSGforHotKey_TextLine2Item1}{MSGforHotKey_TextLine3Item1}{MSGforHotKey_TextLine4Item1}{MSGforHotKey_TextLine5Item1}{MSGforHotKey_TextLine5Item2}{MSGforHotKey_TextLine5Item3}{MSGforHotKey_TextLine5Item4}{MSGforHotKey_TextLine5Item5}{MSGforHotKey_TextLine6Item1}{MSGforHotKey_TextLine7Item1}{MSGforHotKey_TextLine7Item2}{MSGforHotKey_TextLine7Item3}{MSGforHotKey_TextLine7Item4}{MSGforHotKey_TextLine7Item5}{MSGforHotKey_TextLine8Item1}{MSGforHotKey_TextLine9Item1}{MSGforHotKey_TextLine9Item2}{MSGforHotKey_TextLine9Item3}{MSGforHotKey_TextLine9Item4}{MSGforHotKey_TextLine9Item5}{MSGforHotKey_TextLine10Item1}{MSGforHotKey_TextLine10Item2}{MSGforHotKey_TextLine10Item3}{MSGforHotKey_TextLine10Item4}{MSGforHotKey_TextLine10Item5}{MSGforHotKey_TextLine11Item1}{MSGforHotKey_TextLine11Item2}{MSGforHotKey_TextLine11Item3}{MSGforHotKey_TextLine11Item4}{MSGforHotKey_TextLine11Item5}{MSGforHotKey_TextLine12Item1}{MSGforHotKey_TextLine13Item1}{MSGforHotKey_TextLine13Item2}{MSGforHotKey_TextLine13Item3}{MSGforHotKey_TextLine13Item4}{MSGforHotKey_TextLine13Item5}{MSGforHotKey_TextLine14Item1}{MSGforHotKey_TextLine14Item2}{MSGforHotKey_TextLine14Item3}{MSGforHotKey_TextLine14Item4}{MSGforHotKey_TextLine14Item5}{MSGforHotKey_TextLine15Item1}{MSGforHotKey_TextLine15Item2}{MSGforHotKey_TextLine15Item3}{MSGforHotKey_TextLine15Item4}{MSGforHotKey_TextLine15Item5}{MSGforHotKey_TextLine16Item1}{MSGforHotKey_TextLine16Item2}{MSGforHotKey_TextLine16Item3}{MSGforHotKey_TextLine16Item4}{MSGforHotKey_TextLine16Item5}{MSGforHotKey_TextLine17Item1}{MSGforHotKey_TextLine18Item1}{MSGforHotKey_TextLine18Item2}{MSGforHotKey_TextLine18Item3}{MSGforHotKey_TextLine18Item4}{MSGforHotKey_TextLine18Item5}{MSGforHotKey_TextLine19Item1}{MSGforHotKey_TextLine20Item1}"F"{MSGforHotKey_CaptionItem1}{MSGforHotKey_CaptionItem2}{MSGforHotKey_CaptionItem3}{MSGforHotKey_CaptionItem4}{MSGforHotKey_CaptionItem5}"  m)

,;;key CH ;;edited-out 160305 = need to test WHY this was here

else
,end

;Oc_LBX_24k_8item_END_all_LBX_hotkeys
;;;Oc_ID_510271_all_ThisListBox
#12
Sorry there are a ton of variables that populate the message box
#13
I made a mistake on that post!!!!!!!!!!!!!

The 1st "MEM" needs to be commented out and the one 2 lines down needs to be activated. Sorry!
#14
kentatkoylia Wrote:Gintaras,

I have message boxes that 'pop-up' to reveal information about items in a ListBox. Is there a way to insure that this ALWAYS pops up on the same monitor as the ListBox? I mean, can you make this a 'child' of the listbox?

Thanks!

Using function ListDialog()? How do you make it show on a certain monitor? If you use the _monitor variable, then mes() message box also should be on the same monitor because both functions support it. If you use an owner window, let it be the same for both functions.

If you want that the message box would be owned by the list box, I see these ways:
1. Use a custom dialog, not ListDialog().
2. Show the message box in another thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)