Skip to content

Commit

Permalink
Use pointer to int as HINSTANCE for ShellExecuteA
Browse files Browse the repository at this point in the history
Signed-off-by: Maxim Logaev <maxlogaev@proton.me>
  • Loading branch information
mxlgv committed Jun 9, 2024
1 parent d33032b commit 3fd8279
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libdino/src/service/util.vala
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ namespace Dino {
public class Util {
#if _WIN32
[CCode (cname = "ShellExecuteA", cheader_filename = "windows.h")]
private static extern int ShellExecuteA(int* hwnd, string operation, string file, string parameters, string directory, int showCmd);
private static extern int* ShellExecuteA(int* hwnd, string operation, string file, string parameters, string directory, int showCmd);

[CCode (cname = "CoInitialize", cheader_filename = "windows.h")]
private static extern int CoInitialize(void* reserved);

[CCode (cname = "CoUninitialize", cheader_filename = "windows.h")]
private static extern void CoUninitialize();

private static int ShellExecute(string operation, string file) {
private static int* ShellExecute(string operation, string file) {
CoInitialize(null);
var result = ShellExecuteA(null, operation, file, null, null, 1);
CoUninitialize();
Expand Down

0 comments on commit 3fd8279

Please sign in to comment.