INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

How to lock Screen in powerbuilder

How to lock Screen in powerbuilder

(OP)
I have 2 applications which interact each other. App1 is developed in powerbuilder and App2 is in .Net
Powerbuilder application invoke .Net application to do some stuff. My requirement to lock/disable the the power builder application while .Net appliation is doing work.

I have done following code in power builder application to lock the active screen but it fail in few scenarios

mainwindow.enabled=false

Code to invoke .net application

Yield() //wait until .Net application complete his work

mainwindow.enabled=true

Any comment will ab highly appreciated.

Thanks

RE: How to lock Screen in powerbuilder

If you use Windows Scripting Host (WSH) to start your .Niet application, you don't need to do anything to your main window.

The magic is that you instruct WSH to wait for your .Niet application to end before continuing with PowerBuilder code.

example:
wf_run("my.net.program.exe")

CODE -->

public function integer wf_run (string as_command)
integer  li_rc
OleObject lole_wsh

CONSTANT integer MAXIMIZED = 3
CONSTANT integer MINIMIZED = 2
CONSTANT integer NORMAL = 1
CONSTANT integer HIDE = 0
CONSTANT boolean WAIT = TRUE
CONSTANT boolean NOWAIT = FALSE

lole_wsh = CREATE OleObject
li_rc = lole_wsh.ConnectToNewObject( "WScript.Shell" )

li_rc = lole_wsh.Run( as_command, HIDE, WAIT)

if isvalid( lole_wsh ) then 
	lole_wsh.DisconnectObject( )
	destroy lole_wsh
end if

return li_rc

/*
0  Hides the window and activates another window. 
1  Activates and displays a window. If the window is minimized or
   maximized, the system restores it to its original size and position. An
   application should specify this flag when displaying the window for the
   first time. 
2  Activates the window and displays it as a minimized window. 
3  Activates the window and displays it as a maximized window. 
4  Displays a window in its most recent size and position. The
   active window remains active. 
5  Activates the window and displays it in its current size and
   position. 
6  Minimizes the specified window and activates the next top-level
   window in the Z order. 
7  Displays the window as a minimized window. The active window
   remains active. 
8  Displays the window in its current state. The active window
   remains active. 
9  Activates and displays the window. If the window is minimized or
   maximized, the system restores it to its original size and position. An
   application should specify this flag when restoring a minimized window.
10 Sets the show state based on the state of the program that
   started the application. 
*/ 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close