
Image Link Explains What I Am After. Trying To Resize The Browse For Folder Size. Normally Windows Sets This Box Quite Small
Unless You Resize It Manually. I Was Wanting To Set The Size Or Resize It Once It Was Opened.
Moderators: JRL, Dorian (MJT support)
Code: Select all
Dialog>Dialog1
object Dialog1: TForm
Left = 469
Top = 146
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'File Browse Example'
ClientHeight = 288
ClientWidth = 308
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
Position = poDesigned
ShowHint = True
PixelsPerInch = 96
TextHeight = 13
object Label1: TLabel
Left = 16
Top = 16
Width = 53
Height = 13
Caption = 'Enter a file:'
end
object Edit1: TEdit
Left = 16
Top = 41
Width = 248
Height = 21
TabOrder = 8
end
object MSButton1: tMSButton
Left = 269
Top = 41
Width = 21
Height = 21
DoubleBuffered = True
Glyph.Data = {
F6000000424DF600000000000000760000002800000010000000100000000100
0400000000008000000000000000000000001000000010000000000000000000
80000080000000808000800000008000800080800000C0C0C000808080000000
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00777777777777
77777777777777777777000000000007777700333333333077770B0333333333
07770FB03333333330770BFB0333333333070FBFB000000000000BFBFBFBFB07
77770FBFBFBFBF0777770BFB0000000777777000777777770007777777777777
7007777777770777070777777777700077777777777777777777}
ParentDoubleBuffered = False
TabOrder = 9
DoBrowse = False
Filter = 'Text files (*.txt)|*.TXT|Any file (*.*)|*.*'
BrowseStyle = fbFolder
end
object MSMemo1: tMSMemo
Left = 16
Top = 72
Width = 273
Height = 161
ScrollBars = ssBoth
TabOrder = 10
end
object MSButton2: tMSButton
Left = 215
Top = 247
Width = 75
Height = 25
Caption = 'Close'
DoubleBuffered = True
ModalResult = 2
ParentDoubleBuffered = False
TabOrder = 11
DoBrowse = False
BrowseStyle = fbOpen
end
end
EndDialog>Dialog1
AddDialogHandler>Dialog1,MSButton1,OnClick,DoBrowse
Show>Dialog1,r
SRT>DoBrowse
LabelToVar>ReSizeBrowseForFolder,RSBFFdata
WriteLn>%temp_dir%ReSizeBrowseForFolder.scp,wres,RSBFFdata
ExecuteFile>%temp_dir%ReSizeBrowseForFolder.scp
SetDialogProperty>Dialog1,MSButton1,DoBrowse,True
GetDialogProperty>Dialog1,MSButton1,Filename,strFileName
SetDialogProperty>Dialog1,Edit1,Text,strFileName
ReadFile>strFileName,strFileData
SetDialogProperty>Dialog1,MSMemo1,Text,strFileData
DeleteFile>%temp_dir%ReSizeBrowseForFolder.scp
END>DoBrowse
/*
ReSizeBrowseForFolder:
WaitWindowOpen>Browse For Folder
ResizeWindow>Browse For Folder,300,500
MoveWindow>Browse For Folder,100,100
*/
Code: Select all
WriteLn>%TEMP_DIR%ResizeScript.scp,RESIZE,WaitWindowOpen>Folder To Browse*%CRLF%ResizeWindow>Folder To Browse*,100,100
Macro>%TEMP_DIR%ResizeScript.scp
Code: Select all
WriteLn>%TEMP_DIR%ResizeScript.scp,RESIZE,WaitWindowOpen>Folder To Browse*%CRLF%ResizeWindow>Folder To Browse*,100,100
ExecuteFile>%TEMP_DIR%ResizeScript.scp
Sorry... Should never assume a particular file extension is assigned to a particular application.Opened File In Notepad
Code: Select all
///////////// Happy Button Technique ///////////////
//Determine if this process is a script or an exe
//Set mProcessor variable accordingly
StringReplace>COMMAND_LINE,",,COMMAND_LINE
LowerCase>COMMAND_LINE,COMMAND_LINE
ExtractFileName>COMMAND_LINE,value
Trim>value,value
If>value=msched.exe
Let>mProcessor=%COMMAND_LINE%%SPACE%
Else
Let>mProcessor=%COMMAND_LINE% /Script=
EndIf
//If the variable "Script" has a value, then this executable has been
//invoked by itself as a script processing agent. Run the script then exit.
If>Script<>{"Script"}
Macro>Script
Exit>0
EndIF
//This cannot come before the variable "script" test above.
//Define the name of the secondary script and delete it if it exists.
Let>macrofile=%TEMP_DIR%ReSizeBrowseForFolder.scp
IfFileExists>%macrofile%
DeleteFile>%macrofile%
EndIf
//Create the secondary script. One easy way is to use LabelToVar>
LabelToVar>ReSizeBrowseForFolder,RSBFFdata
WriteLn>%macrofile%,wres,RSBFFdata
/*
ReSizeBrowseForFolder:
WaitWindowOpen>Browse For Folder
ResizeWindow>Browse For Folder,300,500
MoveWindow>Browse For Folder,100,100
*/
///////////// Main Script ///////////////
Dialog>Dialog1
object Dialog1: TForm
Left = 469
Top = 146
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'File Browse Example'
ClientHeight = 288
ClientWidth = 308
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
Position = poDesigned
ShowHint = True
PixelsPerInch = 96
TextHeight = 13
object Label1: TLabel
Left = 16
Top = 16
Width = 53
Height = 13
Caption = 'Enter a file:'
end
object Edit1: TEdit
Left = 16
Top = 41
Width = 248
Height = 21
TabOrder = 8
end
object MSButton1: tMSButton
Left = 269
Top = 41
Width = 21
Height = 21
DoubleBuffered = True
Glyph.Data = {
F6000000424DF600000000000000760000002800000010000000100000000100
0400000000008000000000000000000000001000000010000000000000000000
80000080000000808000800000008000800080800000C0C0C000808080000000
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00777777777777
77777777777777777777000000000007777700333333333077770B0333333333
07770FB03333333330770BFB0333333333070FBFB000000000000BFBFBFBFB07
77770FBFBFBFBF0777770BFB0000000777777000777777770007777777777777
7007777777770777070777777777700077777777777777777777}
ParentDoubleBuffered = False
TabOrder = 9
DoBrowse = False
Filter = 'Text files (*.txt)|*.TXT|Any file (*.*)|*.*'
BrowseStyle = fbFolder
end
object MSMemo1: tMSMemo
Left = 16
Top = 72
Width = 273
Height = 161
ScrollBars = ssBoth
TabOrder = 10
end
object MSButton2: tMSButton
Left = 215
Top = 247
Width = 75
Height = 25
Caption = 'Close'
DoubleBuffered = True
ModalResult = 2
ParentDoubleBuffered = False
TabOrder = 11
DoBrowse = False
BrowseStyle = fbOpen
end
end
EndDialog>Dialog1
AddDialogHandler>Dialog1,MSButton1,OnClick,DoBrowse
Show>Dialog1,r
SRT>DoBrowse
//Use the mProcessor variable to run the secondary script
Run>%mProcessor%%macrofile%
/////////////////////////////////////////////////////////
SetDialogProperty>Dialog1,MSButton1,DoBrowse,True
GetDialogProperty>Dialog1,MSButton1,Filename,strFileName
SetDialogProperty>Dialog1,Edit1,Text,strFileName
ReadFile>strFileName,strFileData
SetDialogProperty>Dialog1,MSMemo1,Text,strFileData
DeleteFile>%temp_dir%ReSizeBrowseForFolder.scp
END>DoBrowse