Results 1 to 5 of 5

Thread: **Resolved** Whats the deal with the 256?

  1. #1

    Thread Starter
    Frenzied Member KayJay's Avatar
    Join Date
    Jul 2001
    Location
    Chennai
    Posts
    1,849

    Question **Resolved** Whats the deal with the 256?

    VB Code:
    1. 'In general section
    2. Const EWX_LOGOFF = 0
    3. Const EWX_SHUTDOWN = 1
    4. Const EWX_REBOOT = 2
    5. Const EWX_FORCE = 4
    6. Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
    7. Private Sub Form_Load()
    8.     'KPD-Team 1998
    9.     'URL: [url]http://www.allapi.net/[/url]
    10.     'E-Mail: [email][email protected][/email]
    11. [b][color=red] msg = MsgBox("This program is going to reboot your computer. Press OK to continue or Cancel to stop.", vbCritical + vbOKCancel + 256, App.Title)[/color][/b]
    12.     If msg = vbCancel Then End
    13.     'reboot the computer
    14.     ret& = ExitWindowsEx(EWX_FORCE Or EWX_REBOOT, 0)
    15. End Sub

    So whats the deal with 2^8
    Last edited by KayJay; Nov 7th, 2002 at 06:04 AM.

    "Brothers, you asked for it."
    ...Francisco Domingo Carlos Andres Sebastian D'Anconia

  2. #2
    Fanatic Member
    Join Date
    Feb 2002
    Location
    SE England
    Posts
    732
    This is the same as

    vbDefaultButton2

    They should have used this really..
    Leather Face is comin...


    MCSD

  3. #3

    Thread Starter
    Frenzied Member KayJay's Avatar
    Join Date
    Jul 2001
    Location
    Chennai
    Posts
    1,849
    ok..

    Whats the difference then? having it or not is the same thing.
    VB Code:
    1. Private Sub Command1_Click()
    2. MsgBox "This program is going to reboot your computer. Press OK to continue or Cancel to stop.", vbCritical + vbOKCancel + 256, App.Title
    3. MsgBox "This program is going to reboot your computer. Press OK to continue or Cancel to stop.", vbCritical + vbOKCancel + vbDefaultButton2, App.Title
    4. MsgBox "This program is going to reboot your computer. Press OK to continue or Cancel to stop.", vbDefaultButton2, App.Title
    5. End Sub

    "Brothers, you asked for it."
    ...Francisco Domingo Carlos Andres Sebastian D'Anconia

  4. #4
    PowerPoster
    Join Date
    Aug 2001
    Location
    new jersey
    Posts
    2,904
    Constant Value Description
    vbOKOnly 0 Display OK button only.
    vbOKCancel 1 Display OK and Cancel buttons.
    vbAbortRetryIgnore 2 Display Abort, Retry, and Ignore buttons.
    vbYesNoCancel 3 Display Yes, No, and Cancel buttons.
    vbYesNo 4 Display Yes and No buttons.
    vbRetryCancel 5 Display Retry and Cancel buttons.
    vbCritical 16 Display Critical Message icon.
    vbQuestion 32 Display Warning Query icon.
    vbExclamation 48 Display Warning Message icon.
    vbInformation 64 Display Information Message icon.
    vbDefaultButton1 0 First button is default.
    vbDefaultButton2 256 Second button is default.
    vbDefaultButton3 512 Third button is default.
    vbDefaultButton4 768 Fourth button is default.

    so somebody just got too lazy to type vbDefaultButton2

  5. #5

    Thread Starter
    Frenzied Member KayJay's Avatar
    Join Date
    Jul 2001
    Location
    Chennai
    Posts
    1,849
    Got it. Thanx guys. Should be more observant

    "Brothers, you asked for it."
    ...Francisco Domingo Carlos Andres Sebastian D'Anconia

Posting Permissions

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



Click Here to Expand Forum to Full Width