Results 1 to 9 of 9

Thread: Manipulation MS Windows with VB

  1. #1

    Question Manipulation MS Windows with VB

    Recently I attended a state sciece fair where kids were displaying their projects. One of them I saw had created a kind of "kiosk" on his laptop. Basically it was done in Visual Basic, with two icons to lauch the parts of his project, and a password field to exit the "screen". I asked him how he did it, and he muttered, "With VB." How do you manipulate Windows like this in Visual Basic?

    Thank You - mrlin
    \"Not all humans are reasonably good.\" -John Locke

  2. #2
    Senior Member
    Join Date
    Dec 2001
    Posts
    137
    Are you asking how he maked the password protected exit.
    Its simple below wud be the code

    Private Sub Form_Unload(Cancel As Integer)

    Dim inputanswer As String
    inputanswer = InputBox("What is the password to exit")
    If inputanswer = "password" Then
    Cancel = "0"
    Else
    Cancel = "1"
    End If

    This means that when you try to Unload the form, it asks for a password, If the password is "password" then it does nothing and naturally ends the sub. If the password is anything "ELSE" then Cancel = 1 which cancels the request to end the sub.
    XPaCiScOoL

    [glowpurple]\"Your Smallest Flaw is my greatest Strength.\" - Me[/glowpurple]

  3. #3
    Good job xpaciscool

  4. #4
    Thank You xpac, however i still dont understand how he created the application to act as somewhat of a screensaver. In other words, it was basically a screen saver that could only lauch two applications, and to disable you have to enter the password. The password i know now thanks to you, but how do you create the actual "screensaver" (for lack of a better word).

    Thanks for all your help!
    \"Not all humans are reasonably good.\" -John Locke

  5. #5
    Senior Member
    Join Date
    Sep 2001
    Posts
    150
    most likely it's just an app opened in full screen without a titlebar.

    I dont remember how to do it off the top of my head, but it's not something insanely difficult if you know what you're doing. Just having it run in the startup folder will make it "seem" like a screen saver or new OS type of thing...

  6. #6

    Screen Saver?

    I'm not sure you're looking at it quite the right way. When you say it appeared to be a screen saver type thing I'm assuming you mean that it took up the entire screen? IE, no min/max buttons etc?

    That would be set in design time on your form. Look in the Properties box for options like "MaxButton" and "MinButton", which can be set to True or False.

    He isn't really "manipulating windows" so much as he is taking away the standard windows options from the user. We're just used to having control with standard options that it looks odd if we don't.

    -Keisha
    www.notinourname.net
    www.nion.us

    Read them.

  7. #7
    Senior Member
    Join Date
    Aug 2001
    Posts
    356
    i bet alt+f4 woulda still killed it :-P
    -8-

    There are 10 types of people in this world: those who understand binary, and those who dont.

  8. #8
    Thank you all for the response, I really appreciate it. Still however, I am sure he was doing more than just the design. Now i remember him mentioning a "winapi"??

    I could be wrong, and thank you for the response.

    - mrlin
    \"Not all humans are reasonably good.\" -John Locke

  9. #9
    Junior Member
    Join Date
    May 2002
    Posts
    7
    Well it may have been a screen saver.... they're not that hard to make. I saw a tutorial on some vb site onetime about making one. All you have to do is have a few settings and stuff right then rename it to a *.scr. A screen saver is nothing but a very specific executable. The only real cool thing that i could see to do with this knowledge would be to make a blue screen of death screensaver.... but it's already been done. If you wanta play a harmless joke just find you a blue screen screen saver and load it on to a friends computer.
    winapi is also pretty easy to use. He may have used it like you said. But nothing you described requires it. Winapi allows you to have more complete control over the computer.
    to get started you might find some tutorials at some vb sites and prolly some source code at planet-source-code.com. Basically though all you have to do to use winapi is make a declare at the first of your program for a winapi function. There is a real good website for the api functions even though it is not updated anymore it is www.vbapi.com. It's kinda a reference site. Oh yeah.... there's a add-in in vb called api text view use it and load win32api.txt to automatically insert declares into your code. Here's some winapi code for a really usefull sleep function:

    Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

    Private Sub Command1_Click()
    For x = 0 To 7


    Command1.Caption = Left(Command1.Caption, Len(Command1.Caption) - 1)
    Sleep (500)
    Next x
    End Sub

    This is just some simple code i thought of to demonstrate a winapi function. Try it out!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •