View Full Version : UI: How to detect minimizing of Dialog?
ReneMiner
21-08-2013, 08:12
I'm almost getting a crisis again - as usual when using "UI" for more complicated stuff.
Problem is: I have some multiple Dialogs. One Main-Dialog and a few "Tool-Windows". Now I want them Tool-Windows to hide when the Main-Window get's minimized.
On microsoft-page about %WM-messages it says one has to check for %WM_Size - but that does not occur when minimizing - now I tried and let it print out all callback-parameters whenever something occured but this are so many... I'm almost about to delete the whole stuff I already wrote - how do I find out if the Main-Window got minimized - so I can hide the other windows?
Petr Schreiber
21-08-2013, 09:21
Hi Rene,
try WM_SYSCOMMAND instead:
Case %WM_SYSCOMMAND
If ((CBWPARAM And &h0FFF0) = %SC_MINIMIZE) Then
PrintL "Minimised..."
End If
Just tested it, worked for me...
Petr
ReneMiner
21-08-2013, 09:52
thanks. It works- but see for yourself: "If" & "Case" are basic. The other unreadable stuff has nothing to do with Basic at all... quite frustrating and somehow no fun programming with - these microsoft-sites are all explained in c++ where I have no idea of, so I don't understand what's meant and I can barely read it. To refer to these sites within tB-help does not really help because it ends up in searching & reading for hours on various sites without finding any useful hint. I hate these sites and just opening them in the browser leads me to loose any passion to code for the rest of the day.
Stuck again already: how do I get information together about what the mouse does on a Canvas-Control? Left button, right button, wheel, pointer-position etc.?
I fear I'll never get friends with that callback-stuff.
Petr Schreiber
21-08-2013, 17:51
Hi Rene,
the advantage of current approach is that it closely matches how Windows platform works - it is easy to port code from other languages here, and Win32 programmers feel at home.
On the other, dark side :), it can be frustrating for people with zero previous experience with Win32.
I would like to see having object oriented dialog and control handling, like C# offers. With full documentation, so no need to seek on MSDN. It would be a huge amount of work, but if the constellation is right, we might see something like that in ThinBASIC one day. The OOP module interfaces are the first step making this possible.
Petr
ReneMiner
21-08-2013, 19:11
I see. So have to wait until Win32 becomes obsolete and it's time for something new. That will probably be before I learn how this works- since we got Win64 already and the step to 128 is not far.
In the meantime I'll have to use a large TBGL-Window with own Dialogs inside. Needs a few days - or weeks - but honestly I'd like to wait until I know how the new heap-functions work - which get implemented and how I can make up the memory then. What for I still need own routines etc.
I anyway wanted to create some multiple-use GUI for a long time - the problem of refreshing data-bound controls is solved I think - I can either use Variable_GetInfoEx-functionality or just tell the control WHERE a pointer can be found...Also solved the "waste of memory" when using units which makes the required memory for a Timer-Control as large as a Listview or Gridview - because now I know possibilities to "node" a different subtype at each and every element of the same array quite easy...
Petr Schreiber
21-08-2013, 20:53
Rene - Microsoft is trying to wrap Win32 since... forever. The Windows Forms in .NET are nice OOPish wrapping for example. But Win32 still lives as the underground layer, no matter how much hoax has been about Win32 being replaced completely in Windows 8 for example. I would definitely keep it in ThinBASIC as low level door to Windows, but some OOP wrap would be nice to have.
If you haven't noticed, you can't can't buy a 32 bit version of Windows anymore
John - I am not sure what is the source of your information: even US Amazon (http://www.amazon.com/s/ref=nb_sb_noss_2/184-0981986-2345650?url=search-alias%3Daps&field-keywords=windows%208%2032bit) continues to offer 32bit versions... in Europe it is the same. New tablets ship with 32bit or 64bit too, you can choose.
Petr
ReneMiner
23-08-2013, 07:44
Rene - Microsoft is trying to...
But I don't get it- I used microfrost visual basic for years and that's definetely based on windows. How comes all other languages just have those creepy cumbersume, intransparent callbacks while theirs basic just uses readable words and function names alike "myTextbox_MouseDown(Index, Button, X, Y)" - are they doing this on purpose and spread the wrong information for all the other developers so anyone goes back to vb after trying something else?
Petr Schreiber
23-08-2013, 12:16
They knew Win32 is a bit hardcore for VB coder :) Having something similar in TB would be definitely nice.
Petr