Password Mask for StringGadget

Share your advanced PureBasic knowledge/code with the community.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Password Mask for StringGadget

Post 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
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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]
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: Password Mask for StringGadget

Post 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
Post Reply