Page 1 of 1
Password Mask for StringGadget
Posted: Wed Jan 16, 2002 2:39 pm
by BackupUser
Code updated for 5.20+ (same as StringGadget() with the #PB_String_Password flag)
Restored from previous forum. Originally posted by Rings.
Code: Select all
wFlags = #PB_Window_SystemMenu | #PB_Window_ScreenCentered
OpenWindow(0, #PB_Any, #PB_Any, 280, 60, "Password Mask for StringGadget", wFlags)
hwnd = StringGadget(0, 20, 20, 220, 20, "Siggi war da!")
SendMessage_(hwnd, #EM_SETPASSWORDCHAR, Asc("*"), 0)
While WaitWindowEvent() ! #PB_Event_CloseWindow : Wend
Siggi
Posted: Wed Jan 16, 2002 3:54 pm
by BackupUser
Restored from previous forum. Originally posted by Manolo.
hwnd=StringGadget(0, 20, Top, 200, GadgetHeight, "Siggi war da!")
SendMessage_(hwnd,204,42,0); 42 = asc("*")
Hi Rings,
Tested and work fine.
Manolo
[url]mailto:
vpardo@infonegocio.com[/url]
Posted: Wed Jan 16, 2002 3:59 pm
by BackupUser
Restored from previous forum. Originally posted by PB.
hwnd=StringGadget(0, 20, Top, 200, GadgetHeight, "Siggi war da!")
SendMessage_(hwnd,204,42,0); 42 = asc("*")
Cool tip, and I have two questions:
(1) Where did the number 204 come from?
(2) What does "Siggi war da!" mean?
PB - Registered PureBasic Coder
Posted: Wed Jan 16, 2002 4:16 pm
by BackupUser
Restored from previous forum. Originally posted by Rings.
(1) Where did the number 204 come from?
(2) What does "Siggi war da!" mean?
´
1) it is the constand for
#EM_SETPASSWORDCHAR = &HCC = 204 decimal
or
#EM_GETPASSWORDCHAR = &HD2 = 210 decimal
2) "Siggi war da!"=I'm there (nonsense of course !)
Siggi
Posted: Wed Jan 16, 2002 4:39 pm
by BackupUser
Restored from previous forum. Originally posted by PB.
Where did the number 204 come from?
it is the constand for #EM_SETPASSWORDCHAR
Ah, cool. Thanks for that! And due to teaching me that, here are two more
handy things I was able to learn about StringGadgets:
Code: Select all
SendMessage_(hWnd,#EM_SETREADONLY,1,0) ; Locked (don't let user edit it).
SendMessage_(hWnd,#EM_LIMITTEXT,10,0) ; Don't allow more than 10 chars in it.
PB - Registered PureBasic Coder
Posted: Wed Jan 16, 2002 5:32 pm
by BackupUser
Restored from previous forum. Originally posted by tranquil.
Code: Select all
SendMessage_(hWnd,#EM_SETREADONLY,1,0) ; Locked (don't let user edit it).
SendMessage_(hWnd,#EM_LIMITTEXT,10,0) ; Don't allow more than 10 chars in it.
Nice! That was I'm looking for!

WinAPI Rulez.
Mike
Tranquilizer/ Secretly!
Registred PureBasic User
Posted: Wed Jan 16, 2002 5:50 pm
by BackupUser
Restored from previous forum. Originally posted by Rings.
Ahm, SendMessage is one the most used Api's in the Win-World.
Have anyone from you a list of those Constant's available or have i search the net ?
Siggi
Posted: Wed Jan 16, 2002 7:52 pm
by BackupUser
Restored from previous forum. Originally posted by cor.
FREE API Guide
Go to
http://www.allapi.net
and download api-guide .
The best program around, with examples, parameters
Registered user of PB
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
Posted: Mon May 20, 2002 6:45 pm
by BackupUser
Restored from previous forum. Originally posted by Franco.
Sorry folks this doesn't work anymore [!]
A NEW PureBasic BUG
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Posted: Mon May 20, 2002 10:45 pm
by BackupUser
Restored from previous forum. Originally posted by Fangbeast.
Sorry folks this doesn't work anymore [!]
A NEW PureBasic BUG
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Huh?? Franco, I'm using SendMessage_(hWnd,#EM_SETREADONLY,1,0) on PB 3.1 under Windows XP and it work fine. Haven't tested the others yet as I didn't need them
Fangles
Posted: Mon May 20, 2002 11:12 pm
by BackupUser
Restored from previous forum. Originally posted by Franco.
Hi Fangles, I played with #EM_SETPASSWORDCHAR and it's not working anymore.
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Posted: Tue May 21, 2002 7:39 am
by BackupUser
Restored from previous forum. Originally posted by Fangbeast.
Hi Fangles, I played with #EM_SETPASSWORDCHAR and it's not working anymore.
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
I did say I hadn't tested the others but I was told it has something to do with these new flags Freds going to put in that causes that way not to work currently. We shall see when the new 3.20 is out how it works
Fangles
Re: Password Mask for StringGadget
Posted: Tue Sep 06, 2016 3:13 am
by Keya
does anyone know how to do this in Linux and Mac?
looks like gtk_entry_set_visibility() is the way to go for Linux