KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Click Events and Registry Manipulation

 
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion
View previous topic :: View next topic  
Author Message
zeraphim
KiXforms Novice
KiXforms Novice


Joined: 22 Feb 2004
Posts: 4

PostPosted: Mon Feb 23, 2004 12:57 am    Post subject: Click Events and Registry Manipulation Reply with quote

Hi everyone,

This is a Kix butt tool!!! Laughing

I have 3 questions, and i am really really really hoping that some one can help me?



1. I want to make my own minimize and maximize buttons, as i have set the form Boder style option to 0 so that there is no Border.
As a result, i want to give the clients the option to minimize and maximize but with MY BUTTONs and not depend on having to set the Form Border Style to 1-4.
In Short, Does anyone know how i can get my Button Click event (OnClick) to minimize or maximize the form.

2. I want to set certain textbox fields to be enabled and when clicked on, it will enable that textbox and disable the other fields. How can i do that - is the only option to create somekind of check box or is there a simpler way?

3. I am also creating a tool that will allow me to connect to a clients PC and do a wack load of remote functions. i am having a problem figuring out how to open the clients registry via the internal network - I can do it manually through regedit and mapping to it, but i want to make this tool as usefull as possible. Any suggestions?

You all rock, and thank you in advance.

Zeraphim

Back to top
View user's profile Send private message
sptomey
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 18 Mar 2003
Posts: 158

PostPosted: Mon Feb 23, 2004 2:23 am    Post subject: Reply with quote

The .WindowState property can be used to set the form minimized,maximized,normalized...Here is a sample of the three..

Code:
Break On
$System = CreateObject("Kixtart.System")

$Form = $System.Form()
$Form.BackColor = 224,223,227
$Form.Text = "KiXforms"

$MinButton=$Form.ToolButton("Minimize",20,20,100,20)
$MinButton.OnClick="$$Form.WindowState=1"

$MaxButton=$Form.ToolButton("Maximize",20,50,100,20)
$MaxButton.OnClick="$$Form.WindowState=2"

$NormButton=$Form.ToolButton("Normal",20,80,100,20)
$NormButton.OnClick="$$Form.WindowState=0"

$Form.Show
While $Form.Visible
   $=Execute($Form.DoEvents())
Loop
Exit 1


Dont know of any 'easy' to disable all textboxes except for the one clicked on....Im sure its possible though.

As for the registry...You can use ReadValue and WriteValue as well as all other kix registry functions to modify remote registry. Just include the machine name or IP of the remote system in the registry path. For example...

Code:
$value = ReadValue("\\computername\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion","ProductName")


will return the name of the windows version on the remote machine...

You can also use sendkeys to open regedit to a remote computer...Something like...

Code:
Run 'regedit.exe'
While SetFocus ("Registry Editor") <> 0
   Sleep 0.5
Loop
$null=SendKeys("~F")
$null=SendKeys("C")
$null=SendKeys("ComputerName")
$null=SendKeys("{ENTER}")

_________________
-Shane
Back to top
View user's profile Send private message MSN Messenger
zeraphim
KiXforms Novice
KiXforms Novice


Joined: 22 Feb 2004
Posts: 4

PostPosted: Mon Feb 23, 2004 7:34 am    Post subject: Reply with quote

thank you very much sptomey!
Laughing
It works great,
new issues - trying to have the registry suggestion use PC names rather than IPs and also trying to have vis versa for the OS example

In Short, the registry thing is new to me, can you suggest where i can learn about these reg switches and more for what you had suggested?

as you can see below - here are the functions for 2 buttons
1. the Registry - trying to see how your reg script works
2. the OS Button that i have added just to test out Reg reading from your example



;***************************************************
; Functions
;***************************************************
; Registry button
Function ClientReg()
Messagebox("Connecting to Clients Registry","Connecting Clients Registry",0)
Run 'regedit.exe'
While SetFocus ("Registry Editor") <> 0
Sleep 0.5
Loop
$null=SendKeys("~F")
$null=SendKeys("C")
$null=SendKeys($txtPCName.Text)
$null=SendKeys("{ENTER}")
EndFunction


; Client OS Button
Function ClientOS()
SELECT
; If all of the Fields are blank then return error meassage
CASE $txtPCName.Text <> "" AND $txtIP1.Text <> "" AND $txtIP2.Text <> "" AND $txtIP3.Text <> "" And $txtIP4.Text <> ""
messagebox("You can Fill in only one field at a time!","Only choose one field!",0)
; If all of the Fields are Filled in then return error meassage
CASE $txtPCName.Text = "" And $txtIP1.Text = "" And $txtIP2.Text = "" And $txtIP3.Text = "" And $txtIP4.Text = ""
messagebox("You must Fill in one of the fields first!","Enter a field!",0)
; If PC Name: is filled in and the IP Address: is blank then proceed with PC name.
CASE $txtPCName.Text <> "" AND $txtIP1.Text = "" AND $txtIP2.Text = "" AND $txtIP3.Text = "" And $txtIP4.Text = ""
$PCName = $txtPCName.Text
$PCNameOS = ReadValue("\\$PCName\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion","ProductName")
messagebox("The Clients OS is: $PCNameOS","Finding Clients OS",0)
; If IP Address: is filled in and the PC Name: is blank then proceed with PC name.
CASE $txtIP1.Text <> "" And $txtIP2.Text <> "" And $txtIP3.Text <> "" And $txtIP4.Text <> "" And $txtPCName.Text = ""
$IPAddy = $txtIP1.Text + "." + $txtIP2.Text + "." + $txtIP3.Text + "." + $txtIP4.Text
$IPAddyOS = ReadValue("\\$IPAddy\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion","ProductName")
messagebox("The Clients OS is: $IPAddyOS","Finding Clients OS",0)
ENDSELECT

EndFunction
Return
Back to top
View user's profile Send private message
Sealeopard
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 436
Location: Boston, MA

PostPosted: Mon Feb 23, 2004 3:26 pm    Post subject: Reply with quote

See the WRITEVALUE() function in the KiXtart Manual. It explains how to perform remote registry manipulation. SENDKEYS() approaches should only be used if absolutely necessary and if there;s no other way around.
_________________
Jens

'There are two kinds of vessels, submarines and targets.'
Back to top
View user's profile Send private message Send e-mail MSN Messenger
zeraphim
KiXforms Novice
KiXforms Novice


Joined: 22 Feb 2004
Posts: 4

PostPosted: Tue Feb 24, 2004 5:48 pm    Post subject: Reply with quote

Thanks again,
the advise was accurate and awsome.

Another thing,
NOw that i can map and connect remote registries through the regedit executable, can anyone help me as to how to get the dos (balck window) to stay hidden from the user?
Back to top
View user's profile Send private message
Sealeopard
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 436
Location: Boston, MA

PostPosted: Tue Feb 24, 2004 6:17 pm    Post subject: Reply with quote

Why do you insist on using REGEDIT if you can use internal KiXtart commands for remote registry manupulation?

REGEDIT /S will silently import registry settings.

_________________
Jens

'There are two kinds of vessels, submarines and targets.'
Back to top
View user's profile Send private message Send e-mail MSN Messenger
zeraphim
KiXforms Novice
KiXforms Novice


Joined: 22 Feb 2004
Posts: 4

PostPosted: Wed Feb 25, 2004 12:43 am    Post subject: Reply with quote

Please bare with me as i am a new user to KIX.
I am using the ReadValue() and WriteValue() functions only, as i need to change the SMS Remote connection to allow permissions to auto connect.

When you say commands, which ones do you refer to if not the functions mentioned above?

I'm not going through the regedit.exe, other than for the sake of mapping and opening the clients registry to browse through it manually, if ever need be.

As for my previous blurby question, when i run the kix script - the moment that i click one of my buttons, a black DOS like screen/window pops up on top of my form and reoccurs at every button click event. How can I make that go away - better yet, what causes it - which ever seems easiest to you, as i do apprecitae your time and patience.

When i get home, i will clean up my script and post it for any one to gander at and test so that it is more clear as to how i am scripting and what my objectives are.

Thanks agian for your guidance.

Sincerely,
zeraphim
Back to top
View user's profile Send private message
Chris S.
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 05 Mar 2003
Posts: 241

PostPosted: Wed Feb 25, 2004 3:58 am    Post subject: Reply with quote

z-man,

Check out http://www.kixtart.org/ubbthreads/ specifically the FAQ forum for "Why does the console display zeros and ones (amongst others)?"
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group