Advanced PowerBuilder

HomePrevious Lesson: Browse For the Folder
Next Lesson: Call-Back External Functions

Closing the Current Session And Display Login Screen

Declare a local external function as shown below.
FUNCTION boolean ufx_ExitWindows(uint dwReserved, uint &
  uReserved) LIBRARY "User32.dll" ALIAS FOR "ExitWindowsEx"

The following code calls ufx_CopyFile() which is an alias for CopyFileA() function. This function doesn't display any dialogbox, it simply copies the file. The third argument tells to the function whether it should overwrite the target file if already exists or not.
// Object: cb_close_session
// Event: Clicked
ufx_ExitWindows(0,0)
HomePrevious Lesson: Browse For the Folder
Next Lesson: Call-Back External Functions