Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to identify if the workstation is locked?

How to identify if the workstation is locked?

Scheduled Pinned Locked Moved Visual Basic
csharpdata-structuresregexhelp
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Juvil John
    wrote on last edited by
    #1

    Project Objective: Immitate MSN Messenger when Workstation is locked it sets status to away Details: I made a code to identify if the workstation is locked. using this ---------------------------------------------------------------------------------- Private Declare Sub LockWorkStation Lib "User32.dll" () Private Declare Function SwitchDesktop Lib "User32.dll" _ (ByVal hDesktop As Long) As Long Private Declare Function OpenDesktop Lib "User32.dll" Alias "OpenDesktopA" _ (ByVal lpszDesktop As String, _ ByVal dwFlags As Long, _ ByVal fInherit As Boolean, _ ByVal dwDesiredAccess As Long) As Long ---------------------------------------------------------------------------------- it seems to work fine in VB6 but somehow doesnt work with VB.NET I always got a warning when i pass parameters to the functions ---------------------------------------------------------------------------------- PInvokeStackImbalance was detected Message: A call to PInvoke function 'CSC-RTMS!CSC_RTMS.frmClient::OpenDesktop' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature. ---------------------------------------------------------------------------------- anyone have a solution to my problem?

    J 1 Reply Last reply
    0
    • J Juvil John

      Project Objective: Immitate MSN Messenger when Workstation is locked it sets status to away Details: I made a code to identify if the workstation is locked. using this ---------------------------------------------------------------------------------- Private Declare Sub LockWorkStation Lib "User32.dll" () Private Declare Function SwitchDesktop Lib "User32.dll" _ (ByVal hDesktop As Long) As Long Private Declare Function OpenDesktop Lib "User32.dll" Alias "OpenDesktopA" _ (ByVal lpszDesktop As String, _ ByVal dwFlags As Long, _ ByVal fInherit As Boolean, _ ByVal dwDesiredAccess As Long) As Long ---------------------------------------------------------------------------------- it seems to work fine in VB6 but somehow doesnt work with VB.NET I always got a warning when i pass parameters to the functions ---------------------------------------------------------------------------------- PInvokeStackImbalance was detected Message: A call to PInvoke function 'CSC-RTMS!CSC_RTMS.frmClient::OpenDesktop' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature. ---------------------------------------------------------------------------------- anyone have a solution to my problem?

      J Offline
      J Offline
      Juvil John
      wrote on last edited by
      #2

      nevermind ignore this heheh i found the solution... long and integer.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups