wxWidgets一些代码片段
来源:互联网 发布:最近好听的网络歌曲 编辑:程序博客网 时间:2024/06/05 06:42
版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://axiii.blog.51cto.com/396236/108209
1:获得本程序的进程ID
long gpid;
gpid=::wxGetProcessId();
wxString tempWxString;
tempWxString.sprintf(wxT("%d"), gpid);
wxMessageBox(tempWxString, _("Welcome to..."));
gpid=::wxGetProcessId();
wxString tempWxString;
tempWxString.sprintf(wxT("%d"), gpid);
wxMessageBox(tempWxString, _("Welcome to..."));
2:定时器
::wxStartTimer();
long gt;
gt=::wxGetElapsedTime(true);
wxString tempWxString;
tempWxString.sprintf(wxT("is %d second"), gt/1000);
wxMessageBox(tempWxString, _("Welcome to..."));
long gt;
gt=::wxGetElapsedTime(true);
wxString tempWxString;
tempWxString.sprintf(wxT("is %d second"), gt/1000);
wxMessageBox(tempWxString, _("Welcome to..."));
3:一句话COPY文件
//bool wxCopyFile(const wxString& file1, const wxString& file2, bool overwrite = true)
::wxCopyFile("c://README.TXT","d://1.txt",true);
::wxCopyFile("c://README.TXT","d://1.txt",true);
4:获得系统文件夹
wxString osDirectory;
osDirectory=::wxGetOSDirectory();
wxMessageBox(osDirectory, _("Welcome to..."));
osDirectory=::wxGetOSDirectory();
wxMessageBox(osDirectory, _("Welcome to..."));
5:获得系统版本信息
wxString OsVersion;
OsVersion=::wxGetOsDescription();
wxMessageBox(OsVersion, _("axi Test"));
OsVersion=::wxGetOsDescription();
wxMessageBox(OsVersion, _("axi Test"));
6:窗体坐标
wxPoint wp;
wp=frame->GetClientAreaOrigin();
int x1,y1;
x1=wp.x;
y1=wp.y;
wxString tempWxString;
tempWxString.sprintf(wxT("x: %d y: %d"), x1,y1);
wxMessageBox(tempWxString, _("frame xy"));
wp=frame->GetClientAreaOrigin();
int x1,y1;
x1=wp.x;
y1=wp.y;
wxString tempWxString;
tempWxString.sprintf(wxT("x: %d y: %d"), x1,y1);
wxMessageBox(tempWxString, _("frame xy"));
其他的一些文件操作
::wxRemoveFile
bool wxRemoveFile(const wxString& file)
Removes file, returning true if successful.
::wxRenameFile
bool wxRenameFile(const wxString& file1, const wxString& file2, bool overwrite = true)
Renames file1 to file2, returning true if successful.
If overwrite parameter is true (default), the destination file is overwritten if it exists, but if overwrite is false, the functions fails in this case.
::wxRmdir
bool wxRmdir(const wxString& dir, int flags=0)
Removes the directory dir, returning true if successful. Does not work under VMS.
The flags parameter is reserved for future use.
Please notice that there is also a wxRmDir() function which simply wraps the standard POSIX rmdir() function and so return an integer error code instead of a boolean value (but otherwise is currently identical to wxRmdir), don't confuse these two functions.
bool wxRemoveFile(const wxString& file)
Removes file, returning true if successful.
::wxRenameFile
bool wxRenameFile(const wxString& file1, const wxString& file2, bool overwrite = true)
Renames file1 to file2, returning true if successful.
If overwrite parameter is true (default), the destination file is overwritten if it exists, but if overwrite is false, the functions fails in this case.
::wxRmdir
bool wxRmdir(const wxString& dir, int flags=0)
Removes the directory dir, returning true if successful. Does not work under VMS.
The flags parameter is reserved for future use.
Please notice that there is also a wxRmDir() function which simply wraps the standard POSIX rmdir() function and so return an integer error code instead of a boolean value (but otherwise is currently identical to wxRmdir), don't confuse these two functions.
本文出自 “阿汐的博客” 博客,请务必保留此出处http://axiii.blog.51cto.com/396236/108209
- wxWidgets一些代码片段
- wxWidgets一些代码片段(不断更新中)
- ios一些代码片段
- 一些shell代码片段
- 一些有用的代码片段
- 一些实用PHP代码片段
- zend 一些常用的代码片段
- android一些很有用的代码片段
- Android一些很有用的代码片段
- 一些实用的jQuery代码片段
- 一些实用的jQuery代码片段
- 一些有关图像处理的代码片段
- Andorid中一些重要的代码片段
- 一些实用的JQuery代码片段收集
- 一些实用的jQuery代码片段
- HashTable & HashMap 的一些代码片段
- 一些数据结构题目的代码片段
- 【Matlab】关于Matlab的一些代码片段
- wxWidgets类库结构图
- wxWidgets中贴图操作.
- 一个生成josn格式的java类(转)
- 1056 IMMEDIATE DECODABILITY
- 关于directshow的开发常见问题
- wxWidgets一些代码片段
- www.logoke.com 叫板威客收费模式,20%不是黄金定律!
- ns2中nam文件未显示的原因分析
- 1079 Ratio
- wxTimer的应用-动态输出时间
- 安装sql server 2005出现乱码的问题
- wxWidgets改变窗体位置
- Neophyte
- 1080 Human Gene Functions