Guess what I just ran it in new MAT LAB R2017b in Windows 10 (x64 October 2017 Updated version) and there were errors.
1. Error in <Obj>.waitforuser() - waitfor() requires a valid Matlab handle - Fixed
2. Loadlibrary STDCALL not supported - Fixed
I have just tested it, it worked fine. at least all the examples work. if there are more errors just let me know.
This submission is an implementation of .Net functions like the t
opmostmsg, .Net forms, Tray notification along with my technique to successfully load user32.dll in matlab without a userproto function. Windows functions findwindow, showwindow and setforegroundwindow are currently implemented.
SysObj = SystemTools; SysObj.help;
Syntax: <ClassObj>.waitforuser or <ClassObj>.waitforuser('Short Message')
View General Help.
Syntax: <ClassObj>.TopmostMsg('Message goes here...', 'title', System.Windows.Forms.MessageBoxButtons.YesNo)
View General Help.
Syntax: <ClassObj>.Notify('Balloon Tool Tip', 'Balloon Title', 'Notification App', [pwd '\icon.ico']);
Make sure the icon.ico file is present in current folder to use this syntax.
To remove tray icon use <NotificationIconObj>.Visible = false; followed by <NotificationIconObj>.Dispose();.
Syntax: Stats = <ClassObj>.StartProcess() or <ClassObj>.StartProcess(<Full Path with Ext as String>)
View General Help.
Syntax: Stats = <ClassObj>.AppSelect('Process Name', 'Window State')
Run the demo code below to see it in action.
SysObj = SystemTools;
ProcCred = SysObj.StartProcess;
AppSelStats = SysObj.AppSelect(char(ProcCred.MainWindowTitle), 'SW_SHOWMAXIMIZED');
if AppSelStats>0, disp('Operation Successfull');
else disp('Operation Failed'); end
else msgbox('The Process has exited');
Every function in this class requires .NET support.
So make sure to call <Class Obj>.NETFramework() at least once before any function calls.
Vishnu (2020). Matlab loadlibrary user32.dll for windows functions in one class (https://www.mathworks.com/matlabcentral/fileexchange/49149-matlab-loadlibrary-user32-dll-for-windows-functions-in-one-class), MATLAB Central File Exchange. Retrieved .
Your work is what I am looking for to study.
By the way, if I want to call some strange function in this library with the C struct pointer input like BOOL GetWindowRect(hWnd, LPRECT); How should I add this in your program？I tried libstruct to convert but it seems not work.
Just change the stdcall to cdecl
I've fixed it. check it out..
I am using MATLAB Version: 22.214.171.124613 (R2015a) x86... on Win 7 Ultimate... So may be you guys try the same configuration.
This is exactly what I am looking for. Tray notification work very well but I am getting a error message 'The function call type stdcall is not supported' when running ShowWindow. Initially I thought it was due to missing user32.h but I still get the same error. Any help on this will be appreciated. Thanks...
I get the stdcall error on ML 2014 64bit windows
Following the "NOT WORKING" Accusations I have uploaded a working video proof...
Following the "NOT WORKING" acquisitions I have uploaded a working video proof...
I also had the 'unsupported stdcall' error using R2013b and R2015a.
I also got an error trying to start the demo with a 32-bit Matlab on a 64-bit machine.
when I run the 'ShowWindow_Demo' Errors come up:
Error using loadlibrary (line 440)
The function call type stdcall is not supported
Error in SystemTools.AppSelect (line 210)
if ~libisloaded('WinUser32Lib'), loadlibrary('user32.dll','LoadLib.mat','alias','WinUser32Lib');
Error in ShowWindow_Demo (line 8)
AppSelStats = SysObj.AppSelect(char(ProcCred.MainWindowTitle), 'SW_SHOWNORMAL');
What's wrong with the function of loadlibrary? I'm using Matlab R2014b
[Mostly Bug Fixes]
[Mostly Bug Fix with new Matlab x64 and new Windows 10 x 64]
Added Working Video Proof