Any ideas why this is crashing???

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
shocam
Newbie
Posts: 16
Joined: Thu Jun 08, 2006 8:03 am

Any ideas why this is crashing???

Post by shocam » Sat Mar 24, 2007 4:06 pm

I have a script which runs a dialog box for password input. To make this box look better I used the dll method to remove the borders etc. Now, when this script is run on certain PCs it crashes MS to the point where the only way to stop it is to end the process in task manager. The code is below, can anybody see what the problem might be, bearing in mind that it does work perfectly on some PCs????

:?

Code: Select all

Let>WS_CAPTION=12582912
Let>WS_MINIMIZEBOX=131072
Let>WS_MAXIMIZEBOX=65536
Let>WS_BORDER=524288
Let>WS_THICKFRAME=262144
Let>WS_POPUP=2147483648
Let>WS_CHILD=1073741824
Let>WS_BORDER=8388608

Dialog>User_Info
   Caption=Enter password
   Width=445
   Height=250
   Top=365
   Left=400
   Image=U:\Macro Scheduler\work in progress\back.jpg,0,0,443,248
   Label=PLEASE ENTER YOUR PASSWORD,128,16,true
   Label=%Curr_User%,200,64,true
   RadioGroup=msRadioGroup1,,64,56,321,73,,-1
   Edit=Password,168,88,121,Enter Password
   Button=Submit,96,168,75,25,1
   Button=Cancel,192,168,75,25,2
   Button=Admin,288,168,75,25,3
EndDialog>User_Info

Show>User_Info
Let>style={%WS_BORDER%}
LibFunc>user32,FindWindowA,dhwnd,TForm,Enter password
LibFunc>User32,FindWindowExA,edit1Hwnd,dlgHwnd,0,TEdit,User_Info.Label1
LibFunc>user32,SetWindowLongA,sres,dhwnd,-16,style



CloseDialog>User_Info
Show>User_Info,result

I cannot figure this one for the life of me!!!!

Thanks for any help you can give.......

User avatar
JRL
Automation Wizard
Posts: 3529
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon Mar 26, 2007 1:02 am

No idea... It locks up on my Win XP SP2 computer. I tried several things including removing the braces form the line Let>style={%WS_BORDER%} . You have WS_BORDER defined twice, I tried both of them. I tried removing the second libfunc line thinking it might be extraneous. No matter what I tried the script locked when I ran it. The other interesting thing is that it ran and completed fine if I ran the script in the editor.

If you are using a Macro Scheduler version greater than 7.4 you should be able to accomplish the same dialog border style by using Close=0 in the dialog definition

Code: Select all

Dialog>User_Info
   Caption=Enter password
   Width=445
   Height=250
   Top=365
   Left=400

   Close=0

   Image=U:\Macro Scheduler\work in progress\back.jpg,0,0,443,248
   Label=PLEASE ENTER YOUR PASSWORD,128,16,true
   Label=%Curr_User%,200,64,true
   RadioGroup=msRadioGroup1,,64,56,321,73,,-1
   Edit=Password,168,88,121,Enter Password
   Button=Submit,96,168,75,25,1
   Button=Cancel,192,168,75,25,2
   Button=Admin,288,168,75,25,3
EndDialog>User_Info

Show>User_Info,result

shocam
Newbie
Posts: 16
Joined: Thu Jun 08, 2006 8:03 am

Post by shocam » Mon Mar 26, 2007 9:42 am

JRL wrote:No idea... It locks up on my Win XP SP2 computer. I tried several things including removing the braces form the line Let>style={%WS_BORDER%} . You have WS_BORDER defined twice, I tried both of them. I tried removing the second libfunc line thinking it might be extraneous. No matter what I tried the script locked when I ran it. The other interesting thing is that it ran and completed fine if I ran the script in the editor.

If you are using a Macro Scheduler version greater than 7.4 you should be able to accomplish the same dialog border style by using Close=0 in the dialog definition

Code: Select all

Dialog>User_Info
   Caption=Enter password
   Width=445
   Height=250
   Top=365
   Left=400

   Close=0

   Image=U:\Macro Scheduler\work in progress\back.jpg,0,0,443,248
   Label=PLEASE ENTER YOUR PASSWORD,128,16,true
   Label=%Curr_User%,200,64,true
   RadioGroup=msRadioGroup1,,64,56,321,73,,-1
   Edit=Password,168,88,121,Enter Password
   Button=Submit,96,168,75,25,1
   Button=Cancel,192,168,75,25,2
   Button=Admin,288,168,75,25,3
EndDialog>User_Info

Show>User_Info,result
Thanks for the reply JRL, I have version 8 and i didnt know about Close=0. I'll give it a go and let you know.....

shocam
Newbie
Posts: 16
Joined: Thu Jun 08, 2006 8:03 am

Post by shocam » Mon Mar 26, 2007 6:52 pm

Hi again

i tried Close=0 but it didnt do anything........

:(

mike

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts