DPI Awareness -- Why am I just now learning about this? - Page 2 - Forum

Forum Navigation
You need to log in to create posts and topics.

DPI Awareness -- Why am I just now learning about this?

PreviousPage 2 of 2
Quote from Talker on May 31, 2023, 1:20 am

@PaulJonestindall

Which action in dec_Plus restarts your app? I have an English translation (kindly provided by Vadim) but I cannot find the Restart action...

Where can I download the NeoDouble plug-in?

The Command is "npReiniciarPub".

You can download David Esperalta's NeoDouble plugin here.

(The ZIP file contains the v1.0.6 in an EXE file).

Greetings.

Thank you. I appreciate it.

npReiniciarPub will restart my app, but it won't bring it to the front :-(. I need to manually click it in the taskbar to focus.

I tried to add Run to focus it (the application is singleton) and also BringAppToFront, but that does not seem to make a difference.

Any ideas?

 

Quote from Talker on June 2, 2023, 1:17 am

I tried to add Run to focus it (the application is singleton) and also BringAppToFront, but that does not seem to make a difference.

Any ideas?

@talker, this should work.

Just replace WinCmdTest.exe with your application exe.  Program could be distributed with restart.bat file or even written to temp folder.

FileWrite "[PubDir]restart.bat" "1" "CMD.exe [#34]/c taskkill /IM WinCmdTest.exe /F[#34]"
FileWrite "[PubDir]restart.bat" "2" "CMD.exe [#34]/c WinCmdTest.exe[#34]"
Run "CMD.exe" "/c restart.bat" "Hidden" "" ""

Interesting solution Brad.

I will try that.

Thanks.

@talker

If I understood the problem correctly, one line of code from the hpwAutoIt (Hans-Peter Wickern) plugin is enough to display the application window on top.

The [PubDir] variable in this example specifies the path to the folder where AutoItDll.DLL is located.

hpwAutoItWinRestore "[PubDir]" "ShowPub" ""

Uploaded files:
  • You need to login to have access to uploads.

@talker

LOL. I completely forgot. No plugin required.

SetVar "[WindowState]" "Normal"

@Darbdenral
The restart.bat file works perfectly on its own, just not when it is being called with a button (Run command) from the app itself. In that case, my app comes up behind the active window.

@Vadim
The same here. It works but it comes up behind the active window.

I've also got an external C# executable that activates my app. Again, that works perfectly fine on its own, just not when it is called from within the app itself.

I'm beginning to believe that this issue is specific to my computer for some reason.

Anyway, thanks both for your contributions.

@talker

Hmm..  it works fine here.  So, maybe something running on the computer is grabbing the top position.  But, first I would try it in a new app with only the button and command and see what happens.. Also, I'm assuming that your running the compiled exe and not using the VisualNeo start function..

I attached pub source..

good luck!

 

Uploaded files:
  • You need to login to have access to uploads.
Talker has reacted to this post.
Talker

Thanks, Brad! Your sample app works and eventually, I had no other choice but to move the elements from my app to your sample app and now it works :-). It's a complete mystery why it wouldn't work out of the box in my own app, but anyway I'm happy it works now.

One small nit. I like to install my apps in a subfolder of the user's Program Files (x86) directory. But Windows won't allow access to creating the restart.bat there. Unless I run the app as Administrator.

Is there any way to make my app run with administrative rights automatically?

@talker

Yes, you can run the batch file normally without elevated rights by creating the batch file into the temp directory and run it from there.

So try this new pub file attached.  Just compile it without making any changes.  Then put the RestartApp.exe in any folder you like under the Program Files (x86) directory and run it.

In essence, we are essentially performing a task that could be achieved with a plugin. However, we are utilizing the tools already provided by Windows. Nonetheless, @gaev and other individuals have proposed several plugins that may be suitable, especially considering the recent revelation of an unidentified issue.

Uploaded files:
  • You need to login to have access to uploads.

@darbdenral / @talker

AND don't forget, your file does NOT need an exe extension to run from Neo.  To hide such things, I oftentimes name it to .dll and address it using our native RUN command.  So perhaps instead of RestartApp.exe, you can name it ra.dll and work outta temp with it.   Do a check if file exists, and if not, put one there from "baggage" files.

 

 

Talker has reacted to this post.
Talker

Thanks, Brad. This works well.

Looks like all my issues are solved :-).

Darbdenral has reacted to this post.
Darbdenral

@talker

Sorry for the delay. The dec_Plus action is dec_ReiniciarLaPublicacion.

Can you provide the translation file? I don't have one for this or NeoDouble.

I only have the English translation for  dec_Plus. I've attached it

if anyone has a translation for NeoDouble please upload it.

Uploaded files:
  • You need to login to have access to uploads.
PreviousPage 2 of 2