Matlab loadlibrary user32.dll for windows functions in one class

版本 1.3.0.0 (4.1 KB) 作者: Vishnu
Implement topmostmsg, .Net forms, Tray notification, findwindow, showwindow & setforegroundwindow
666.0 次下载
更新时间 2017/10/18

查看许可证

[UPDATE]
Guess what I just ran it in new MAT LAB R2017b in Windows 10 (x64 October 2017 Updated version) and there were errors.
[Bug Fixed]
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;
waitforuser Function:
Syntax: <ClassObj>.waitforuser or <ClassObj>.waitforuser('Short Message')
View General Help.
TopmostMsg Function:
Syntax: <ClassObj>.TopmostMsg('Message goes here...', 'title', System.Windows.Forms.MessageBoxButtons.YesNo)
View General Help.
Notify Function:
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();.

StartProcess Function:

Syntax: Stats = <ClassObj>.StartProcess() or <ClassObj>.StartProcess(<Full Path with Ext as String>)

View General Help.

AppSelect Function:

Syntax: Stats = <ClassObj>.AppSelect('Process Name', 'Window State')

Run the demo code below to see it in action.

...Demo Code...

SysObj = SystemTools;
SysObj.NETFramework();
ProcCred = SysObj.StartProcess;
if ~ProcCred.HasExited
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');
end
<<<<<<<<<>>>>>>>>>

General Help:
Every function in this class requires .NET support.
So make sure to call <Class Obj>.NETFramework() at least once before any function calls.

引用格式

Vishnu (2024). 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. 检索来源 .

MATLAB 版本兼容性
创建方式 R2017b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Migrate GUIDE Apps 的更多信息
致谢

参考作品: WindowAPI

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.3.0.0

[Mostly Bug Fix with new Matlab x64 and new Windows 10 x 64]
1. Error in <Obj>.waitforuser() - waitfor() requires a valid Matlab handle - Fixed
2. Loadlibrary STDCALL not supported - Fixed
[Error]
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.
[Mostly Bug Fixes]
Just Nothing I uploaded the wrong file lads.. this ones new

1.2.0.0

Added Working Video Proof
updated

1.1.0.0

Update 0

1.0.0.0