cursor

How do you set hotspot co-ordinates on a Windows cursor generated from an icon file?

情到浓时终转凉″ 提交于 2019-12-04 16:15:18
I'm setting a custom cursor on my app from an icon file, but the click point is at the wrong co-ordinates. I'm setting the cursor with SetClassLongPtr(hwnd, GCL_HCURSOR, reinterpret_cast<LONG_PTR>cursor) where cursor is the result of; LoadImage( NULL, "some_path/cursor.ico", IMAGE_ICON, //also tried IMAGE_CURSOR 0, //width. 0 uses the width of the file provided 0, //height. 0 uses the height of the file provided LR_LOADFROMFILE ); The cursor loads fine, but its clicks come from the bottom-left corner of the cursor image, rather than top left. The wikipedia article on .ico files says the

contentEditable javascript caret placement in div

对着背影说爱祢 提交于 2019-12-04 15:48:39
问题 I have a contentEditable div. Let's say the user clicks a button that inserts HTML into the editable area. So, they click a button and the following is added to the innerHTML of the contentEditable div: <div id="outside"><div id="inside"></div></div> How do I automatically place the cursor (ie caret) IN the "inside" div? Worse. How can this work in IE and FF? 回答1: For IE: var range= document.body.createTextRange(); range.moveToElementText(document.getElementById('inside')); range.select();

Custom cursor in C# Winforms

房东的猫 提交于 2019-12-04 15:40:55
Does anyone know of an easy way to use a custom cursor? I have both a .cur and .png of my cursor. I tried adding it as a resource to my project and also tried including it as a file in the project. Ideally I'd like to embed it but I just want to get it working. When I use Cursor cur = new Cursor("mycursor.cur") I get "Image format is not valid. The image file may be corrupted". I tried this http://mahesg.wordpress.com/2008/02/09/embedding-cursor/ but it didn't work. Using WinForm1.Properties.Resources.mycursor returns a byte[] which I have no idea how to convert into a Cursor type. For some

SQLite query run on UI thread with ExpandableListView/SimpleCursorTreeAdapter

笑着哭i 提交于 2019-12-04 14:55:36
I'm in the progress of developing an Android app for displaying a number of RSS feeds (yes, I know there are many apps like this already). The data to be displayed is backed by a content provider, and I want to be backward compatible with API level 4. I'm using an ExpandableListView to display the content of three different RSS feeds. The ExpandableListView 's adapter is implemented as a sub-class of SimpleCursorTreeAdapter : private class RssFeedLatestListAdapter extends SimpleCursorTreeAdapter { public static final String FEED_NAME_COLUMN = "feedName"; public RssFeedLatestListAdapter(Context

c++ win32 set cursor position

夙愿已清 提交于 2019-12-04 14:27:33
问题 I know which function to use but I can't get it to work right. I used SetCursorPos() the only problem is that it sets the cursor not to the windows coordinates but to the screen coordinates. i also tried the ScreenToClient() but it didn't work ethier. Here is my code: pt.x=113; pt.y=280; ScreenToClient(hWnd, &pt); SetCursorPos(pt.x, pt.y); any idea? I'm using win32. I hope that I given enough information. 回答1: You're approaching this slightly backwards. The SetCursorPos function works in

Nullpointerexcepiton on cursor while selecting photo from gallery on dialog fragment

♀尐吖头ヾ 提交于 2019-12-04 14:07:07
I'm trying to select photo from gallery through DialogFragment . But I'm getting nullpointerexception while initializing cursor . Any ideas why getting this error? Below is my code : if (resultCode == Activity.RESULT_OK) { Uri selectedImage = imageReturnedIntent.getData(); String[] filePathColumn = {MediaStore.Images.Media.DATA}; // Nullpointerexcepiton on this line Cursor cursor = getActivity().getContentResolver().query(selectedImage, filePathColumn, null, null, null); cursor.moveToFirst(); int columnIndex = cursor.getColumnIndex(filePathColumn[0]); cursor.close(); } Here is my logcat error

How to set the area/rectangle in which the cursor is allowed to move?

為{幸葍}努か 提交于 2019-12-04 13:52:15
E.g. when you hit the side of your monitor your cursor can't go any further, and more of an example is when in microsoft paint, and your choosing a colour from the RGB table, it won't allow your mouse to go outside of the rectangle while your mouse is down.. my question is how would you implement that in c++ with win32 api? You can use the following function from Microsoft BOOL WINAPI ClipCursor( __in_opt const RECT *lpRect ); See http://msdn.microsoft.com/en-us/library/ms648383(VS.85).aspx Use the ClipCursor function. Simply provide the rectangle to confine the cursor to. To release the mouse

游标

落花浮王杯 提交于 2019-12-04 13:23:51
1 --游标知识点 2 --1、在SELECT 语句中使用DISTINCT、 GROUP BY、 HAVING UNION 语句时, 游标将自动设定INSENSITIVE 选项。 3 --2、SCROLL表明所有的提取操作(如FIRST、 LAST、 PRIOR、 NEXT、 RELATIVE、 ABSOLUTE)都可用。如果不使用该保留字,那么只能进行NEXT 提取操作。 4 --例8.4.1: 游标演示 5 declare c_cursor scroll cursor for 6 select * from student 7 open c_cursor 8 fetch last from c_cursor 9 fetch prior from c_cursor 10 fetch absolute 2 from c_cursor 11 fetch relative 2 from c_cursor 12 fetch relative -2 from c_cursor 13 fetch first from c_cursor 14 fetch prior from c_cursor 15 fetch next from c_cursor 16 fetch c_cursor 17 close c_cursor 18 deallocate c_cursor 19 --例8.4.2

Navigate manually with a cursor through nested lists by only providing “left()” and “right()” as commands?

六月ゝ 毕业季﹏ 提交于 2019-12-04 13:08:05
问题 Eventhough I write in python I think the abstract concept is more interesting to me and others. So pseudocode please if you like :) I have a list with items from one of my classes. Lets do it with strings and numbers here, it really doesn't matter. Its nested to any depth. (Its not really a list but a container class which is based on a list.) Example : [1, 2, 3, ['a', 'b', 'c'] 4 ['d', 'e', [100, 200, 300]] 5, ['a', 'b', 'c'], 6] Note that both ['a', 'b', 'c'] are really the same container.

How to get phone number from person name which are in my contact list in android

牧云@^-^@ 提交于 2019-12-04 12:29:12
I want to get phone no of the person from his name which are in my contact list. i have used the below code but it is not working fine. Tell me where i am wrong. try { cursor_company =getContentResolver().query(ContactsContract.Data.CONTENT_URI, null,ContactsContract.Data.DISPLAY_NAME+ " = " + "sidharth", null, null); } catch(Exception e) { System.out.println("this is exception "+e); } String phone_number; while (cursor_company.moveToNext()) { Phone_number =cursor_company.getString( cursor_company.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER)); System.out.println(" this is user