forum.sourcecode (2000-2005) & forum.td.sourcecode (2005-2010)
-
BSB
Post
by BSB » 28 Aug 2007, 13:46
Posted by: BSB
Hi Folks,
How can i trap when i am switching windows from the Windows Menu ? I want to
validate when i am switching modules from Windows Menu.
Thanks in Advance.
Seshu.
-
Mirko

- Posts: 1299
- Joined: 04 Apr 2017, 08:56
- Location: Geneva
Post
by Mirko » 29 Aug 2007, 11:55
Posted by: Mirko BONANNO
If I understand correctly, SAM_Activate may be an option for you !
-
BSB
Post
by BSB » 29 Aug 2007, 13:41
Posted by: BSB
Mirko,
Sorry for not stating my problem in detail. The issue in my case is i have a
SAM_Validate message in a datafield. I enter some value there and click on
the Windows Menu to switch to other module. I want the SAM_Validate message
to fire.
I can use SalSendValidateMessage( ) from my custom menus. How to handle for
Windows Menu ?
Thanks,
Seshu.
-
Niels Allerheiligen
Post
by Niels Allerheiligen » 29 Aug 2007, 15:06
Posted by: Niels Allerheiligen
Perhaps you can trap SAM_KillFocus on your datafield.
On SAM_KillFocus
Call SalSendMsg(hWndItem, SAM_Validate, wParam, lParam)
-
BSB
Post
by BSB » 29 Aug 2007, 15:35
Posted by: BSB
Niels,
I need to add SAM_KillFocus for each instance. I need a common solution
where i can handle for all instances from the menu level.
Thanks,
Seshu.
-
arvindram11

- Posts: 555
- Joined: 14 Apr 2019, 23:42
- Location: Richmond, VA
Post
by arvindram11 » 29 Aug 2007, 21:59
Posted by: Aravind Ram
How about WM_INITMENU at the form level?
WM_INITMENU = 0x0116
Aravind
-
Mirko

- Posts: 1299
- Joined: 04 Apr 2017, 08:56
- Location: Geneva
Post
by Mirko » 30 Aug 2007, 08:34
Posted by: Mirko BONANNO
Hi Niels,
SAM_Validate is supposed to be fired BEFORE SAM_KillFocus (and only if the
field value has changed) !
And if you tab off a field you will get SAM_Validate fired twice (and the
2nd time even if the value of the field is not changed)
-
BSB
Post
by BSB » 31 Aug 2007, 07:54
Posted by: BSB
Hi Mirko,
Is there any way i can trap the switching of modules from windows menu and
send SAM_Validate message to the field that has focus?.
Thanks,
Seshu.
-
Mirko

- Posts: 1299
- Joined: 04 Apr 2017, 08:56
- Location: Geneva
Post
by Mirko » 31 Aug 2007, 17:06
Posted by: Mirko BONANNO
Hi Seshu,
did you try what Aravind suggested ?
What hapens if you call SalSendValidateMessage( ) on WM_INITMENU (or on
SAM_Activate when wParam is FALSE) ?
BTW I still do not understand why SAM_Validate is not fired automatically
when switching to a menu ! Yes I know (IIRC that's what I was told years
ago) this is windows default behavieur !
Let us know if you find a solution please (& have a nice week-end)
Mirko
-
Mirko

- Posts: 1299
- Joined: 04 Apr 2017, 08:56
- Location: Geneva
Post
by Mirko » 31 Aug 2007, 17:26
Posted by: Mirko BONANNO
Well,
I just made a little test and noticed that you cannot stop processing
neither on WM_INITMENU nor SAM_Activate :-( !
So maybe an API-Guru could tell us wich message we could use instead !!!
:-((((((((((((((((((((((((
Mirko
PS Have a nice w-e anyway ;-)
Who is online
Users browsing this forum: [Ccbot] and 0 guests