Sign in to follow this  
Followers 0
doestergaard

Emulate Product Key field in Windows

3 posts in this topic

#1 ·  Posted (edited)

Hi

First off, I want to thank this community for being so much helpful, I really appreciate it! I'm not a hardcore autoit scripter and therefore need your expertise to crack this one.

The following code works:

Func _Options()

  Local $myGUI = GUICreate("ProductKeyInput", 412, 240, -1, -1, $WS_CAPTION)
  Local $inputKey = GUICtrlCreateInput("", 39, 41, 260, 24, $ES_UPPERCASE)
  GUICtrlSetLimit($myInput, 29, 0)
  GUISetState()

  While ControlFocus("", "", $myInput)

    Local $stringKey = GUICtrlRead($inputKey)

    Switch StringLen($stringKey)
    
      Case 5

        ControlSend("", "", $inputKey, "-")

    EndSwitch

  WEnd

EndFunc

But because that i checks constantly if the stringlen is 5 then you'll have a big problem with using the backspace key.

Is it possible to emulate the product key field entirely from Windows so that you are able to use the backspace key ?

Product-Key-Windows-8.jpg

Thanks!

Edited by doestergaard

Share this post


Link to post
Share on other sites




Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

That worked like a charm!

Thx a lot  :sorcerer:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0