在wince下如何禁止移动vb窗体移动

新手园地& & & 硬件问题Linux系统管理Linux网络问题Linux环境编程Linux桌面系统国产LinuxBSD& & & BSD文档中心AIX& & & 新手入门& & & AIX文档中心& & & 资源下载& & & Power高级应用& & & IBM存储AS400Solaris& & & Solaris文档中心HP-UX& & & HP文档中心SCO UNIX& & & SCO文档中心互操作专区IRIXTru64 UNIXMac OS X门户网站运维集群和高可用服务器应用监控和防护虚拟化技术架构设计行业应用和管理服务器及硬件技术& & & 服务器资源下载云计算& & & 云计算文档中心& & & 云计算业界& & & 云计算资源下载存储备份& & & 存储文档中心& & & 存储业界& & & 存储资源下载& & & Symantec技术交流区安全技术网络技术& & & 网络技术文档中心C/C++& & & GUI编程& & & Functional编程内核源码& & & 内核问题移动开发& & & 移动开发技术资料ShellPerlJava& & & Java文档中心PHP& & & php文档中心Python& & & Python文档中心RubyCPU与编译器嵌入式开发驱动开发Web开发VoIP开发技术MySQL& & & MySQL文档中心SybaseOraclePostgreSQLDB2Informix数据仓库与数据挖掘NoSQL技术IT业界新闻与评论IT职业生涯& & & 猎头招聘IT图书与评论& & & CU技术图书大系& & & Linux书友会二手交易下载共享Linux文档专区IT培训与认证& & & 培训交流& & & 认证培训清茶斋投资理财运动地带快乐数码摄影& & & 摄影器材& & & 摄影比赛专区IT爱车族旅游天下站务交流版主会议室博客SNS站务交流区CU活动专区& & & Power活动专区& & & 拍卖交流区频道交流区
白手起家, 积分 152, 距离下一级还需 48 积分
论坛徽章:0
using Susing System.Collections.Gusing System.Tusing System.IO;using System.C
namespace SJAnalyzer //我的空间命名,你可以需要改一下。{&&& class ceIniFiles&&& {&&&&&&& string IniFileN&&&&&&& char[] TrimChar ={ ' ', '\t' };
&&&&&&& public ceIniFiles(string IniF)&&&&&&& {
&&&&&&&&&&& IniFileName = IniF;&&&&&&& }
&&&&&&& public string[] GetSects()&&&&&&& {&&&&&&&&&&& string[] Sects=&&&&&&&&&&&&&&&&&&&&&& if (File.Exists(IniFileName))&&&&&&&&&&& {&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ArrayList ls = new ArrayList();&&&&&&&&&&&&&&& TextReader tr = File.OpenText(IniFileName);&&&&&&&&&&&&&&& while ((str = tr.ReadLine()) != null)&&&&&&&&&&&&&&& {&&&&&&&&&&&&&&&&&&& str = str.Trim();&&&&&&&&&&&&&&&&&&& if ((str.StartsWith("[")) && (str.EndsWith("]")))&&&&&&&&&&&&&&&&&&&&&&& ls.Add(str);&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }&&&&&&&&&&&&&&& tr.Close();
&&&&&&&&&&&&&&& if (ls.Count & 0)&&&&&&&&&&&&&&& {&&&&&&&&&&&&&&&&&&& Sects =new string[ls.Count];&&&&&&&&&&&&&&&&&&& for ( int i=0;i&ls.Ci++)&&&&&&&&&&&&&&&&&&& {&&&&&&&&&&&&&&&&&&&&&&& Sects[i] = ls[i].ToString();&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }&&&&&&&&&&&&&&& }&&&&&&&&&&& }
&&&&&&&&&&& return S&&&&&&& }
&&&&&&& public int WriteString(string sect, string keystr, string valuestr)&&&&&&& {&&&&&&&&&&& ArrayList ls = new ArrayList();&&&&&&&&&&& bool SectOK =&&&&&&&&&&& bool SetOK =
&&&&&&&&&&& if (File.Exists(IniFileName))&&&&&&&&&&& {&&&&&&&&&&&&&&& int pos1;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& TextReader tr = File.OpenText(IniFileName);&&&&&&&&&&&&&&& while ((str = tr.ReadLine()) != null)&&&&&&&&&&&&&&& {&&&&&&&&&&&&&&&&&&& ls.Add(str);&&&&&&&&&&&&&&& }&&&&&&&&&&&&&&& tr.Close();
&&&&&&&&&&&&&&& //开始寻找关键字,如果找不到,则在这段的最后一行插入,然后再整体的保存一下INI文件。&&&&&&&&&&&&&&& for (int i = 0; i & ls.C i++)&&&&&&&&&&&&&&& {&&&&&&&&&&&&&&&&&&& str = ls[i].ToString();
&&&&&&&&&&&&&&&&&&& if (str.StartsWith("[") && SectOK) //先判断是否到下一段中了,如果本来就是最后一段,那就有可能永远也不会发生了。&&&&&&&&&&&&&&&&&&& {&&&&&&&&&&&&&&&&&&&&&&& SetOK = //如果在这一段中没有找到,并且已经要进入下一段了,就直接在这一段末添加了。&&&&&&&&&&&&&&&&&&&&&&& ls.Insert(i, keystr.Trim() + "=" + valuestr);&&&&&&&&&&&&&&&&&&&&&&&//如果到下一段了,则直接退出就好。&&&&&&&&&&&&&&&&&&& }&&&&&&&&&&&&&&&&&&& if (SectOK)&&&&&&&&&&&&&&&&&&& {&&&&&&&&&&&&&&&&&&&&&&& pos1 = str.IndexOf("=");&&&&&&&&&&&&&&&&&&&&&&& if (pos1 & 1)&&&&&&&&&&&&&&&&&&&&&&& {&&&&&&&&&&&&&&&&&&&&&&&&&&& substr = str.Substring(0, pos1);&&&&&&&&&&&&&&&&&&&&&&&&&&& substr.Trim(TrimChar);&&&&&&&&&&&&&&&&&&&&&&&&&&& //如果在这一段中找到KEY了,直接修改就好了。&&&&&&&&&&&&&&&&&&&&&&&&&&&
if (substr.Equals(keystr, StringComparison.OrdinalIgnoreCase)
&& SectOK) //是在此段中,并且KEYSTR前段也能匹配上。&&&&&&&&&&&&&&&&&&&&&&&&&&& {&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& SetOK =&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ls[i] = keystr.Trim() + "=" +&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }&&&&&&&&&&&&&&&&&&&&&&& }&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&& if (str.StartsWith("[" + sect + "]")) //判断是否到需要的段中了。&&&&&&&&&&&&&&&&&&&&&&& SectOK =&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&& if (SetOK == false)&&&&&&&&&&&&&&& {&&&&&&&&&&&&&&&&&&& SetOK =&&&&&&&&&&&&&&&&&&& if (!SectOK) //如果没有找到段,则需要再添加段。&&&&&&&&&&&&&&&&&&& {&&&&&&&&&&&&&&&&&&&&&&& ls.Add("[" + sect + "]");&&&&&&&&&&&&&&&&&&& }&&&&&&&&&&&&&&&&&&& ls.Add(keystr.Trim() + "=" + valuestr);&&&&&&&&&&&&&&& }&&&&&&&&&&& } //如果文件不存在,则需要建立文件。&&&&&&&&&&& else&&&&&&&&&&& {&&&&&&&&&&&&&&& ls.Clear();&&&&&&&&&&&&&&& ls.Add("##文件创建:" + DateTime.Now.ToString() + "##");&&&&&&&&&&&&&&& ls.Add("[" + sect + "]");&&&&&&&&&&&&&&& ls.Add(keystr.Trim() + "=" + valuestr);&&&&&&&&&&& }
&&&&&&&&&&& if (File.Exists(IniFileName)) //删除源文件。&&&&&&&&&&& {&&&&&&&&&&&&&&& File.Delete(IniFileName);&&&&&&&&&&& }
&&&&&&&&&&& TextWriter tw= File.CreateText(IniFileName);
&&&&&&&&&&& //string[] strList = new string[ls.Count];
&&&&&&&&&&& for (int i = 0; i & ls.C i++)&&&&&&&&&&& {&&&&&&&&&&&&&&& //strList[i] = ls[i].ToString();&&&&&&&&&&&&&&& tw.WriteLine(ls[i].ToString());&&&&&&&&&&& }&&&&&&&&&&& tw.Flush();&&&&&&&&&&& tw.Close();
&&&&&&&&&&& //File.WriteAllLines(IniFileName, strList);&&&&&&&&&&& return 0;&&&&&&& }
&&&&&&& public string ReadString(string sect, string keystr, string defaultstr)&&&&&&& {&&&&&&&&&&& string retstr =&&&&&&&&&&& if (File.Exists(IniFileName))&&&&&&&&&&& {&&&&&&&&&&&&&&& bool SectOK =&&&&&&&&&&&&&&& int pos1;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ArrayList ls = new ArrayList();&&&&&&&&&&&&&&& TextReader tr = File.OpenText(IniFileName);&&&&&&&&&&&&&&& while ((str = tr.ReadLine()) != null)&&&&&&&&&&&&&&& {&&&&&&&&&&&&&&&&&&& str = str.Trim();&&&&&&&&&&&&&&&&&&& if (str.StartsWith("[") && SectOK) //先判断是否到下一段中了。&&&&&&&&&&&&&&&&&&& {&&&&&&&&&&&&&&&&&&&&&&&//如果到下一段了,则直接退出就好。&&&&&&&&&&&&&&&&&&& }&&&&&&&&&&&&&&&&&&& if (SectOK)&&&&&&&&&&&&&&&&&&& {&&&&&&&&&&&&&&&&&&&&&&& pos1 = str.IndexOf("=");&&&&&&&&&&&&&&&&&&&&&&& if (pos1 & 1)&&&&&&&&&&&&&&&&&&&&&&& {&&&&&&&&&&&&&&&&&&&&&&&&&&& substr = str.Substring(0, pos1);&&&&&&&&&&&&&&&&&&&&&&&&&&& substr.Trim(TrimChar);
&&&&&&&&&&&&&&&&&&&&&&&&&&& if (substr.Equals(keystr, StringComparison.OrdinalIgnoreCase)) //是在此段中,并且KEYSTR前段也能匹配上。&&&&&&&&&&&&&&&&&&&&&&&&&&& {&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& retstr = str.Substring(pos1 + 1 ).Trim(TrimChar) ;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }&&&&&&&&&&&&&&&&&&&&&&& }&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&& if (str.StartsWith("[" + sect + "]")) //判断是否到需要的段中了。&&&&&&&&&&&&&&&&&&&&&&& SectOK =
&&&&&&&&&&&&&&& }&&&&&&&&&&&&&&& tr.Close();&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&& }
&&&&&&& //读整数&&&&&&&& public int ReadInteger(string Section, string Ident, int Default)&&&&&&& {&&&&&&&&&&& string intStr = ReadString(Section, Ident, Convert.ToString(Default));&&&&&&&&&&& try&&&&&&&&&&& {&&&&&&&&&&&&&&& return Convert.ToInt32(intStr);&&&&&&&&&&& }&&&&&&&&&&& catch&&&&&&&&&&& {&&&&&&&&&&&&&&& return D&&&&&&&&&&& }&&&&&&& }
&&&&&&& //写整数&&&&&&&& public void WriteInteger(string Section, string Ident, int Value)&&&&&&& {&&&&&&&&&&& WriteString(Section, Ident, Value.ToString());&&&&&&& }
&&&&&&& //读布尔&&&&&&&& public bool ReadBool(string Section, string Ident, bool Default)&&&&&&& {&&&&&&&&&&& try&&&&&&&&&&& {&&&&&&&&&&&&&&& return Convert.ToBoolean(ReadString(Section, Ident, Convert.ToString(Default)));&&&&&&&&&&& }&&&&&&&&&&& catch&&&&&&&&&&& {&&&&&&&&&&&&&&& return D&&&&&&&&&&& }&&&&&&& }
&&&&&&& //写Bool&&&&&&&& public void WriteBool(string Section, string Ident, bool Value)&&&&&&& {&&&&&&&&&&& WriteString(Section, Ident, Convert.ToString(Value));&&&&&&& }
&&&&&&& /////////////////////////////////////////////////////////////////////////&&&&&&& //使用此INI文件的特例(自己使用)&&&&&&& public string GetParam(string KeyStr, string Default)&&&&&&& {&&&&&&&&&&&&&&&&&&&&&& str = this.ReadString("Params", KeyStr, "???");&&&&&&&&&&& if (str=="???")&&&&&&&&&&& {&&&&&&&&&&&&&&& this.WriteString("Params",KeyStr,Default);&&&&&&&&&&&&&&& str = D&&&&&&&&&&& }&&&&&&&&&&&&&&&&&& }
&&&&&&& public void UpdateParam(string KeyStr, string ValueStr)&&&&&&& {&&&&&&&&&&& this.WriteString("Params", KeyStr, ValueStr);&&&&&&& }&&& }}
北京盛拓优讯信息技术有限公司. 版权所有 京ICP备号 北京市公安局海淀分局网监中心备案编号:22
广播电视节目制作经营许可证(京) 字第1234号
中国互联网协会会员&&联系我们:
感谢所有关心和支持过ChinaUnix的朋友们
转载本站内容请注明原作者名及出处【mobile wince】 - CSDNc#程序,在wince6.0 下,如果禁止移动窗口
[问题点数:100分,结帖人ysjydss]
本版专家分:20
结帖率 94.44%
CSDN今日推荐
本版专家分:20
本版专家分:20
本版专家分:20
匿名用户不能发表回复!|
其他相关推荐当前位置: →
→ WinCE或者WinMobile能不能直接运行Windows台式机上的应用程序该如何处理
WinCE或者WinMobile能不能直接运行Windows台式机上的应用程序该如何处理
& 作者:佚名 & 来源: 互联网 & 热度:
&收藏到→_→:
摘要: WinCE或者WinMobile能不能直接运行Windows台式机上的应用程序?WinCE或者WinMobile能不能直接运行Windows台式机上的应用程序...
"WinCE或者WinMobile能不能直接运行Windows台式机上的应用程序该如何处理"::
wince或者winmobile能不能直接运行windows台式机上的?wince或者winmobile能不能直接运行windows台式机上的?------解决方案--------------------当然不能
------解决方案--------------------如果使用的.net开发的manage code,是有可能的;如果是用sdk,mfc开发的native code,那肯定是不行了。
------解决方案--------------------我只用过sdk,不能
------解决方案--------------------如果用的是.net,有可能行,如果是wm sdk开发的,肯定不行的!
------解决方案--------------------不能,结构,cpu指令都不一样
------解决方案--------------------如果是程序源代码,可以做移植,工作量也不大。
如果是.exe程序,那么如果不是x86平台,那是肯定不行的!指令集都不一样,怎么可能执行呢?
------解决方案-------------------- &exe程序应该是由windows来解释啊,跟cpu指令集无关啊,已经通过windows这一层抽象了 & 你从哪里来的这个概念?
------解决方案--------------------是由windows解释的,首先各个windows是不同的。
即使exe在是windows 98/2k之间都有不能运行的可能。更不要说是ce啦!
cpu的指令,是每个exe的组成部分。各自系此文来自: 马开东博客
转载请注明出处 网址:
统对cpu指令的组织也是不一样的。
------解决方案--------------------我觉得有必要说下,那种不同平台的程序如果要用的话,也要看懂算法后自己开发,随便把别人开发的东西移植过来,连平台问题都搞不清楚,就不要在名片上写嵌入式工程师那几个字了。
------解决方案--------------------难道.exe程序不是由windows解释?既然不由解释,那为什么不同的上用同样的cpu,还是无法执行同一个.exe程序?即,windows上的exe程序可以不加转换地移植到linux上吗,如果它们用的cpu相同的话。
这个是因为两个对地址空间的组织和管理都完全不同吧,而这些都是程序执行绝对会牵扯到的问题。
至于.exe程序跟cpu指令集无关这一概念,应该是错误的。 搜索此文相关文章:该如何处理此文来自: 马开东博客
网址: 站长QQ
上一篇:没有了
WinCE或者WinMobile能不能直接运行Windows台式机上的应用程序该如何处理_WinCE相关文章
WinCE_总排行榜
WinCE_最新
WinCE_月排行榜
WinCE_周排行榜
WinCE_日排行榜在上一篇文章讲述了取进程信息的方法,链接如下:
本文讲述取出进程对应窗口句柄的方法。&
程序是在上一篇文章的例子上进行修改的。
核心代码如下:ProcessWndsInfo procIprocInfo.processId = it-&th32ProcessID;if (EnumWindows(EnumWindowsProc, (LPARAM)&procInfo) == FALSE){
wprintf(TEXT("EnumWindowsProc Failed.
Error: %d\n"),
GetLastError());
continue;}
通过调用EnumWindows()来取出进程下所有窗口信息。EnumWindows()函数的第一个参数是 回调函数的指针,代码如下:BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam){
ProcessWndsInfo* procInfo = (ProcessWndsInfo*)lP
DWORD ProcessId;
GetWindowThreadProcessId ( hwnd, &ProcessId );
if (procInfo != NULL && ProcessId == procInfo-&processId)
procInfo-&windowsHandles.push_back(hwnd);
// Keep enumerating
return true;
由于EnumWindows()函数轮询所有窗口,每个窗口都会会回调EnumWindowsProc()一次。所以需要判断这个窗口所属进程号。如果属于该进程,就当到list里面。
ProcessWndsInfo的定义如下:struct ProcessWndsInfo{
DWORD processId;
std::list&HWND& windowsH};
包含的进程ID和进程下所有窗口的句柄的list。
下面是显示窗口句柄信息的代码。// Output information for each running processfor( std::list&PROCESSENTRY32&::iterator it=processes.begin();
it!=processes.end(); ++it){
wprintf(TEXT("%-*s %8X %13d %9d %9X %10X\n"),
maxProcessNameLength,
it-&szExeFile,
it-&th32ProcessID,
it-&pcPriClassBase,
it-&cntThreads,
it-&th32MemoryBase,
it-&th32AccessKey
ProcessWndsInfo procI
procInfo.processId = it-&th32ProcessID;
if (EnumWindows(EnumWindowsProc, (LPARAM)&procInfo) == FALSE)
wprintf(TEXT("EnumWindowsProc Failed.
Error: %d\n"),
GetLastError());
//Output a header to describe the HWnd
wprintf(TEXT("\tHWnd\t\tWindows Title\n"));
WCHAR title[255];
for( std::list&HWND&::iterator itHWnd=procInfo.windowsHandles.begin();
itHWnd!=procInfo.windowsHandles.end(); ++itHWnd)
//Get title of the window
GetWindowText(*itHWnd, title, 255);
wprintf(TEXT("\t%10X\t%s\n"), *itHWnd, title);
为了显示更详细的信息,我把窗口名称一同显示了。效果如下:
由于我在wince下进行开发的,不是通用平台,我把项目文件删掉了,上传源代码,只用于参考。
阅读(...) 评论()

我要回帖

更多关于 禁止窗体被用户移动 的文章

 

随机推荐