Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Open Explorer to Passed Directory

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Game Hacking Dojo
Expert Cheater
Reputation: 1

Joined: 17 Sep 2023
Posts: 147

PostPosted: Wed Jul 10, 2024 8:03 am    Post subject: Open Explorer to Passed Directory Reply with quote

How do I open the explorer to the directory I specify?

Example:
Code:
openExplorer(getMainForm().OpenDialog1.InitialDir)


As a result, a window from Windows opens at the given path.
Thanks

Edit:

Okay I found one way:
Code:
shellExecute(explorer, getMainForm().OpenDialog1.InitialDir)
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 34

Joined: 16 Feb 2017
Posts: 1402

PostPosted: Wed Jul 10, 2024 3:42 pm    Post subject: Reply with quote

Presumably "mf.OpenDialog1" implements its own default function at runtime.

If you trigger it, you may be able to implement some changes.

Here is an example;
Code:
if form2 then form2.destroy() form2 = nil end
form2 = createForm()
form2.Popupmode = 0;
form2.Position = poDesktopCenter
form2.Width = 200
form2.Height = 160

btn1=createButton(form2)
btn1.Left=20 btn1.Top=20 btn1.Width=110
btn1.caption="Path: C"

btn2=createButton(form2)
btn2.Left=40 btn2.Top=60 btn2.Width=110
btn2.caption="Path: Desktop"

btn3=createButton(form2)
btn3.Left=60 btn3.Top=100 btn3.Width=110
btn3.caption="Path: Temp"

od1 = getMainForm().OpenDialog1
dir1 = ([[C:\]])
dir2 = os.getenv("USERPROFILE") .. "\\Desktop";
dir3 = getTempFolder()

btn1.OnClick=function()
od1.InitialDir = dir1
od1.Execute()
  filename = od1.Filename
  print(filename)
end

btn2.OnClick=function()
od1.InitialDir = dir2
od1.Execute()
  filename = od1.Filename
  print(filename)
end

btn3.OnClick=function()
od1.InitialDir = dir3
od1.Execute()
  filename = od1.Filename
  print(filename)
end

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites