Does VB6's open statement uses the API? - winapi

How openworks behind the scenes? It calls the WinAPI such as OpenFile, CreateFile, or ReadFile?
Thanks in advance.

Ultimately the VB runtime calls CreateFile to open a file.

Definitely it doesn't use de API. The open statement uses the __vbaFileOpen() function from msvbvm60.dll.

Related

How can I call Windows API functions using emacs lisp?

I want to call some Windows API functions to manipulate Windows Input Method Editor to make my Emacs an IME-aware application. How can I call Windows API functions using Emacs lisp?
Thank you!
I dont believe its possible to directly call native code from emacs; the best you'll be able to achieve is to proxy calls to the Windows API through another process, and communicate with it through IPC
Check this stackoverflow question:
load a dynamic library from elisp
I think maybe need a proxy interface, but use w32-send-sys-command can do little things,
code 61776 can send hotkey maybe worth a try

Call and Execute a Function on a DLL using VBScript

My target DLL file is Microsoft DirectInput dll file which is located here:
C:\Windows\System32\Dinput.dll
I have monitored an application which uses it for API. I just see that it has call for "DirectInputCreateEx" on Dinput.dll and I did not found any other useful information.
Now I want to call and execute "DirectInputCreateEx" on Dinput.dll using VBScript.
Is this possible? How?
You could only do this (possibly) if it was a COM object. VBScript does not support calling normal API functions.
You can get around this by creating a COM wrapper for it in C++ or similar language.

Win32API: how to create a shortcut (.lnk file)

I'm a Java developer, so please excuse my ignorance.
I want to create a shortcut to an executable, e.g., in the user's autostart or send-to folder (I don't want an installer to do that, because the installer usually is run by an administrator). What API (C preferred) I could use for that task (maybe using JNA)? Thanks in advance.
As #Hans indicated, it requires COM (via ShellLinkObject or WScript.Shell). In Java you can call COM objects using a Java to COM bridge. There are a few available, ranging from free to commercial. A couple that I know of are:
Java2COM
JACOB
JCOM
It requires using COM, ShellLinkObject from shell32.dll. No idea what that takes in Java, but you'll find C# code in my answer in this thread.

Alternative solution to WINAPI CreateFile()

I am developing program on window's using msys and mingw. I want to have similar function as provided by WINAPI CreateFile(). Is there any solution for this?
Regards,
Dhaval
The POSIX api for opening files is fopen - or documented # OpenGroup.

Win32 equivalent of opendir

Would anyone know what the Win32 equivalent of opendir is (or if it even exists) ?
Obviously I could use FindFirstFile(Ex) with FindNextFile, but appending * to the path seems like such a hackish way to do it.
FindFirstFile and FindNextFile are the appropriate Win32 APIs. Assuming you're writing C++ code, as a portable alternative you could consider using directory_iterator from the Boost Filesystem library (which is implemented on Windows using FindFirstFile and FindNextFile).
I believe you can use CreateFile with FILE_FLAG_BACKUP_SEMANTICS and then BackupRead to read directory data, but I'm not sure what format the data is actually in. Also, you would need to be running as a user with the SE_BACKUP_NAME privilege enabled, so this is not really suitable in a general purpose application.

Resources