WS_VSCROLL,CreateWindow风格的作品,SetWindowLong不(WS_VSCROLL, CreateWindow style works, SetWindowLong doesnt)
当我做
wnd = CreateWindow("EDIT", 0, WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN, x, y, w, h, parentWnd, NULL, NULL, NULL);
一切都很好,但是如果我删除WS_VSCROLL和WS_HSCROLL然后执行下面,我不明白他们有不正确的窗口。 为什么? 如果WS_VSCROLL和WS_HSCROLL都丢失,我不仅会得到不正确的窗口,而且它也不可用
style = WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN; SetWindowLong(wnd, GWL_STYLE, style);
When i do
wnd = CreateWindow("EDIT", 0, WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN, x, y, w, h, parentWnd, NULL, NULL, NULL);
everything is fine, however if i remove the WS_VSCROLL and WS_HSCROLL then do the below, i do not get them thus have incorrect window. Why? Not only do i get an incorrect window it is unusable if both WS_VSCROLL and WS_HSCROLL are missing
style = WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN; SetWindowLong(wnd, GWL_STYLE, style);
原文:https://stackoverflow.com/questions/285587
最满意答案
你确定viewDidLoad是添加此代码的最佳位置吗?
尝试在一些更频繁调用的方法中添加代码。 为了调试我通常添加一些按钮只是为了调用NSLog来看看会发生什么。
Are you sure viewDidLoad is the best place to add this code?.
Try to add your code in some method which is called more often. For debugging I usually add some button just to call a NSLog to see what happens.
相关问答
更多-
ListView仅在重新启动应用程序时更新条目(ListView updates the entry only when the application is restarted again)[2021-08-10]
在数据库中插入条目后,应再次获取数据,以使列表具有最新条目。 因此,您可以修改代码,以便能够将数据点添加到要传递给适配器的列表,或者在插入之后和notifyDatasetChanged()之前从数据库中重新获取数据。 After you insert the entries in your database, you should fetch the data again so that your list has the newest entry. So you can either modify you ... -
据我所知,您不需要重新启动应用程序,只需重新创建与数据库的连接,这是因为驱动程序在内存中保存了与程序包的先前编译版本的链接,因此新连接将获得更新版。 它通常在PLSQL / Oracle数据库上观察到,它与驱动程序有关,而与Java无关。 看看这个问题/答案, Tomcat是否使用了pl / sql模块的缓存版本? ,它对如何克服这种情况有一些建议。 希望能帮助到你! As far as I know, you don't need to restart your application, just rec ...
-
NSUserdefaults在应用程序重新启动之前不会更新(NSUserdefaults not updating till the application restarted)[2021-09-26]
你确定viewDidLoad是添加此代码的最佳位置吗? 尝试在一些更频繁调用的方法中添加代码。 为了调试我通常添加一些按钮只是为了调用NSLog来看看会发生什么。 Are you sure viewDidLoad is the best place to add this code?. Try to add your code in some method which is called more often. For debugging I usually add some button just to ... -
如果您通过按下主页按钮(在模拟器或设备上)终止您的应用程序,则NSUserDefaults将被保存。 如果您通过在Xcode(模拟器或设备)中按“停止”终止您的应用程序,则NSUserDefaults 可能会被保存,但是很有可能不会。 NSUserDefaults会定期NSUserDefaults任何更改,如果在过程持久化之前终止进程,那么它们将会消失。 你可以通过调用来强制保存: [[NSUserDefaults standardUserDefaults] synchronize]; 附录: 在iOS4 ...
-
您可以检查并存储系统正常运行时间以及上次运行时间,并将其与当前正常运行时间进行比较。 使用C#检索系统正常运行时间 一些psudeocode: DateTime computerLastStarted = Now - Uptime; if (computerLastStarted > storedComputerLastStarted + or - tollerance) { storedComputerLastStarted = computerLastStarted; ...
-
您需要重新加载组合框。 假设您使用此方法填充组合框 public void LoadCb() { SqlConnection cn = new SqlConnection("connectionstring"); SqlDataAdapter da = new SqlDataAdapter("select DealerId, DealterName from Dealers", cn); DataTable dt = new DataTable(); da.Fill(dt); ...
-
在重新启动应用程序后,containsObject返回NO(containsObject is returning NO after the app is restarted)[2023-08-19]
您需要确保为自定义类定义了一个好的isEqual:方法,因为这是NSArray用来确定包含的内容: https : //developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation / Classes / NSArray_Class /#// apple_ref / occ / instm / NSArray / containsObject : 假设这个类有类似'key'或'id'的值,对于每个类的实例(在你的例子中是do ... -
如何在Android Oreo中更新应用程序后重新启动前台服务?(How to restart foreground service after app updating in Android Oreo?)[2023-12-04]
首先,并非所有的隐式广播都被禁止。 有一个白名单 。 其次, ACTION_MY_PACKAGE_CHANGED是一个明确的广播,只发送给你的应用程序。 引用文档 : 面向Android 8.0或更高版本的应用程序无法再在其清单中注册隐式广播的广播接收器。 隐式广播是不针对该应用的广播。 例如,ACTION_PACKAGE_REPLACED是一个隐式广播,因为它被发送给所有注册的监听者,让他们知道设备上的某些软件包已被替换。 但是,ACTION_MY_PACKAGE_REPLACED不是隐式广播,因为它只发 ... -
当用户从应用商店安装更新时,将不会触及应用沙箱的可写文档文件夹(包括用户默认值和数据库文件)中的数据。 您可以在更新后更改这些文件。 The data in the writeable documents folder (including user defaults and database file) of your apps sandbox will not be touched when the user installs the update from the app store. You may ...
-
几乎所有Cassandra客户端都应该支持这种情况而不必重新启动(据我所知,所有数据驱动程序都是这样做的)。 例如,在java驱动程序中,当节点出现故障并再次出现时,将其标记为可用时首先要做的事情之一是重新显示应用程序已注册的所有PreparedStatements 。 此外,如果您在应用程序中使用PreparedStatement进行查询,并且Cassandra节点响应它不知道该语句,则客户端应准备该查询并重试该请求 。 Almost all Cassandra clients should suppor ...