flat assembler
Message board for the users of flat assembler.

Index > Windows > [SOLVED] MDI editor

Author
Thread Post new topic Reply to topic
frech



Joined: 10 Mar 2009
Posts: 31
frech
Hi to everybody!
First of all thanks for anyone who helped me with my first problem about getting HIWORD(wparam) and LOWORD(wparam).
Now I'm facing with a similar problem: I decided to convert my application into an MDI one, but now I need a "local" flag to NotSaved state. By "local" I mean a flag who "belongs" to any child windows, and not a "global" flag for all the program, otherwise if I set that flag to TRUE one time for a date child window, it will be TRUE even for all the other children windows.
I discovered for example
Code:
invoke  GetWindowLong,[hwnd],GWL_USERDATA    
to catch a single child window at a time, but still I can't set nor get a local variable...
Any tip?


Description:
Download
Filename: ISIDE.zip
Filesize: 9.98 KB
Downloaded: 34 Time(s)



Last edited by frech on 14 Apr 2009, 07:37; edited 3 times in total
Post 24 Mar 2009, 07:10
View user's profile Send private message Visit poster's website Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 764
Location: Massachusetts, USA
bitshifter
You can store a variable in the windows extra dword like...
Code:
invoke SetWindowLong,[hwnd],GWL_USERDATA,[variable]
    

You could even use this dword to store a pointer to a structure.
Post 03 Apr 2009, 21:03
View user's profile Send private message Reply with quote
frech



Joined: 10 Mar 2009
Posts: 31
frech
Thx, bitshifter.
I one way or oneother, now I'm able to set that variable, and I solved the problem.
Now I wonder if I can just set a variable or if I can also check its value. I mean, in this editor I set GWL_USERDATA to Saved or NotSaved according to the state of the child control, but with this method can I use just one variable "State" and change its value from TRUE to FALSE or viceversa?
Post 07 Apr 2009, 12:24
View user's profile Send private message Visit poster's website Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 764
Location: Massachusetts, USA
bitshifter
SetWindowLong returns the previous value.
Post 07 Apr 2009, 15:35
View user's profile Send private message Reply with quote
frech



Joined: 10 Mar 2009
Posts: 31
frech
But only of that variable, I suppose. I mean, if I use
Code:
invoke SetWindowLong,[hwnd],GWL_USERDATA,[variable]    
and then
Code:
invoke SetWindowLong,[hwnd],GWL_USERDATA,[variable2]    
a following
Code:
invoke GetWindowLong,[hwnd],GWL_USERDATA    
would return the value of [variable2] at the moment it was set, and not [variable]. Am I right?
So, I think I should set a [struct] instead of [variable] and [variable2], so when I invoke GetWindowLong I would retrieve the whole [struct] and I'd be able to check the values of its elements, is this correct?
Post 08 Apr 2009, 09:45
View user's profile Send private message Visit poster's website Reply with quote
frech



Joined: 10 Mar 2009
Posts: 31
frech
I solved the problem, sending EM_SETMODIFY and EM_GETMODIFY messages instead of invoking SetWindowLong and GetWindowLong.
Thx.
Post 09 Apr 2009, 09:21
View user's profile Send private message Visit poster's website Reply with quote
frech



Joined: 10 Mar 2009
Posts: 31
frech
I solved the problem sending EM_SETMODIFY and EM_GETMODIFY messages instead of invoking SetWindowLong and GetWindowLong. Thx.

But now I'm facing with a new problem (what's life without a bit of spice? Wink ). I substituted the edit control with a richedit one, because of some further modifications I'll implement later, and I also made a change to the section of code which controls if the richedit has been modified or not (I discovered that richedit controls don't produce EN_CHANGE messages).

The new problem is that if I open a file and then close it without editing it, it closes, but if I open two files and ask to close them all, again without any modification, only the first one closes, but the other asks me for a confirm. Also new, untitled child windows ask me for the same confirm, even if I set EM_SETMODIFY to FALSE... Mad

Any hint?


Description:
Download
Filename: ISIDE.zip
Filesize: 10.53 KB
Downloaded: 34 Time(s)

Post 09 Apr 2009, 13:28
View user's profile Send private message Visit poster's website Reply with quote
frech



Joined: 10 Mar 2009
Posts: 31
frech
I'm also looking at the source of MDIRichEdit by habran, but still I can't figure how to solve this bug...
Post 09 Apr 2009, 13:49
View user's profile Send private message Visit poster's website Reply with quote
frech



Joined: 10 Mar 2009
Posts: 31
frech
Bug fixed. I just needed to send an EM_SETEVENTMASK message with EN_CHANGE as parameter, and now all is ok.
Thx!
Post 14 Apr 2009, 07:37
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.