yashsingh1/xdaforums huggingface dataset:
[Windows Mobile Development and Hacking General] levenum:
Hi hanmin.

Odd I didn't notice this thread sooner.

Any way if you still having problems with this code here is the solution:

You are working with char and strcpy so your text is in ASCII (each letter one byte).

But you are calling SetClipboardData with CF_UNICODETEXT so it expects WCHAR (UNICODE) where each letter is two bytes.

The strange letters are the result of two consecutive bytes being interpreted as a single letter (probably lends you in Chinese or Japanese region of the Unicode table)

Windows mobile doesn't usually work with ASCII so the text you get from the edit box will already be in Unicode and won't give you any trouble.

The code should look like this:

//put a test char
CString test; //since you are working with MFC save your self the trouble of memory allocation

test = L"The text I want on clipboard"; //The L makes the string Unicode

//codes you've given
if(OpenClipboard()) //OpenClipboard(NULL) gives me error
{
EmptyClipboard();

//not sure why you need to copy it again, but here goes:
HLOCAL clipbuffer = LocalAlloc(0, test.GetLength() * 2); //remember: every letter 2 bytes long!
wcscpy((WCHAR*) clipbuffer, (WCHAR*)(LPCTSTR)test); //LPCTSTR is an overloaded operator for CString
SetClipboardData(CF_UNICODETEXT, clipbuffer);
CloseClipboard();
//szMsg probably belongs to some larger application and is irrelevant
LocalFree(clipbuffer);
}

I never used the clipboard APIs my self so I can't guide you farther but this code should work.

Hope this helps.
[Windows Mobile Development and Hacking General] hanmin:
Wooo hooo.. Thanks levenum. I'm back on business!

You code works wonderfully.. just the final code "LocalFree(clipbuffer);" seems to cause problems. Without that, it works. I'm not sure if it will cause a memory leak.. but that's not much of my concern now :D

Now my Paste also works, and it seems that the magic code is the "LPCTSTR", which I have NO idea what it is (I'm more of a pure C person and.. a Java person :D) Thanks again.
[Windows Mobile Development and Hacking General] levenum:
Glad I could help.

I am working from Ubuntu right know (Linux distro in case you didn't know) so I do not have access to my off-line MSDN files, but I recommend you check out the documentation for SetClipboardData.

It is possible it releases the memory it self so when you call LocalFree the handle is no longer valid.

That could also be the reason why you need to allocate memory instead of passing it the string directly.

As for LPCTSTR it is simple and not C++ related:

#define const* WCHAR LPCTSTR

Its M$ way of saying Long Pointer to Constant STRing

T changes meaning based on what you are working with:

If you work with ASCII TCHAR is char

If you work with Unicode TCHAR is WCHAR

Basically these are just all redefinitions of variable types so you can distinguish what they are used for.

In C++ you can overload operators. For example you can have a function which changes the way ++ works with certain types of variables.

In our case CString class has a function which determines what happens when you try to cast (convert) it to a pointer to string.

Thats all the "magi" code.

Good luck with your app.
[Windows Mobile Development and Hacking General] levenum:
Small update:

Since I had to go in to XP anyway (to change PDAMobiz ROM which kept hanging at random and didn't let me use BT to latest PDAViet which for now seem very good) I took a quick peek at the help files.

Here is why you should not release the memory:
[Windows Mobile Development and Hacking General] hanmin:
levenum, thanks. You've got me almost there. There are several stuff I need to polish up though. Attach is a pre-mature version of what I wanted to do. There are several issues (including the fact that, only the 4 characters of the password are effectively used, which can be easily fix, I think. Just need to find the bug and squash it) that I like to polish up. They are sorted in order of importance (to me):

[1] Keyboard (SIP) pop up.

For this, I digged around and got to know that the function

"SHSipPreference( HWND, SIP_UP)" is the one to used. However, it never did what it suppose to do. I have had it put inside the "OnSetfocusConfirmPasswordEdit()" of the edit box, which should be called when it is set focus. I suspect that is I haven't set the HWND correctly. I have tried "NULL" and also tried using the "CWnd* pParent" from my dialog constructor (generated code my MFC Wizard). None of them worked.

[2] Editbox focusing.

For some reason, the focus on my main-dialog is correct on the editbox of the 'message'. However, on the dialog which is to confirm the password (which I called using

CConfirmPasswordDlg confirmPasswordDlg;
int nResponse = confirmPasswordDlg.DoModal();

is focusing on the 'Ok' button. What I like it to do is to focus on the 'confirmPasswordEdit' box, and it ought to automatically pop up the keyboard (SIP).

[3]Reduced size pop up dialog

I was trying to make the 2nd confirm password dialog smaller, something like a pop up in the PPC rather than something that take up the whole screen without much contents in it. How would you go about doing that? Is it not possible in PPC? E.g, if you were to use Total Commander, and start copying files around, they do have a pop up that does take up the entire screen. I'm suspecting I shouldn't do a "confirmPasswordDlg.DoModal()", and should some what do something myself. I have tried, SetVisible(1) thing, but that doesn't work. Or it shouldn't meant to work because my 1st screen is a dialog screen?

[4]Timer?

I would like to have a function of which after a certain period of idle time, it will clear off the clipboard and close itself. How would I go about doing this? Some sort of background thread thing?

Anyone can shine a light on my issues above? On MS-embedded Visual C++ (free), with Pocket PC 2003 SDK (free)

Attached the Blender-XXTea edition

Works on PPC2005 and WM5 (should work on WM6)

Does not require .NET framework

VERY small (54K)
[Windows Mobile Development and Hacking General] 3waygeek:
In your CConfirmPasswordDlg::OnInitDialog handler, call GetDlgItem(confirmPasswordEdit).SetFocus() and return FALSE. That should handle the focus and possibly the SIP popup.
[Windows Mobile Development and Hacking General] hanmin:
HEY! The focus works! The working code is

((CWnd*) CConfirmPasswordDlg::GetDlgItem(IDC_CONFIRM_PASSWORD_EDIT))->SetFocus();

BTW, I'm wondering, whats the effect of a return TRUE/FALSE on a 'OnInitDialog()'?

Anyway, the keyboard pop up is still not working. I'm using the command

void CConfirmPasswordDlg::OnSetfocusConfirmPasswordEdit() {
SHSipPreference( (HWND)g_pParent, SIP_UP);//
}

which I suspect the 'g_pParent' is NULL. If it is NULL, would it work?
[Windows Mobile Development and Hacking General] levenum:
Ok, I haven't used MFC for a while and almost not at all on PPC but I will give this a shot:

1) MFC forces dialogs to be full-screen. Here is a detailed explanation on how to change that. Note that for some reason this will work only once if you use the same variable (object) to create the dialog several times.

If you use a local variable in say a button handler thats not a problem because the object is destroyed when you exit the function.

2) There is a simple SetTimer API. You can give it a window handle and then add an OnTimer message handler to that window. Or you could give it a separate function which will be called (say TimerProc). In that case you can give it NULL as window handle.

Note that CWnd objects have a member function with the same name (SetTimer) which sets the timer with that window handle (so that window will receive WM_TIMER message). If you want the raw API call ::SetTimer.

Also note that the timer will continue to send messages / call your special function every x milliseconds until you call KillTimer.

3) I am not sure what the problem with the SIP is. CWnd and derived classes like CDialog have a function called GetSafeHwnd (or GetSafeHandle, I don't remember exact name). Try passing that to SHSipPreference.

If that does not work here is an article with an alternate solution.
[Windows Mobile Development and Hacking General] hanmin:
WOHO!! Everything works NOW!!.. MUAHAHHAHA.. wait til you see my release version :D

Non maximized windows works using the code suggested at the page. Although I still do not understand where the heck this '.m_bFullScreen' property came from. It is not anywhere obvious to be seen.

CNfsDlg dlg;
dlg.m_bFullScreen = FALSE;
dlg.DoModal();

Timer works using the

xx{
//your code...
CBlenderDlg::SetTimer(1, 5000, 0); //event 1, 5 seconds, something
//your code...
}

void CBlenderDlg::OnTimer(UINT nIDEvent){
//do something here for the timer
}

although somehow, the OnTimer() only works if I went to the MFC class wizard to add the WM_TIMER function. Doesn't work when I add in the OnTimer() myself. Must be something else that I've missed. Anyway.

Keyboard issue solved using

SHSipPreference( CBlenderDlg::GetSafeHwnd(), SIP_UP);
[Windows Mobile Development and Hacking General] levenum:
Glad its working out for you.

Couple of comments:

1) Somewhere at the top of the cpp file, if I am not mistaking there is something called a message map. It's a bunch of macros that lets MFC know what window messages it handles. An entry there is what was missing when you added the function manually.

2) m_bFullScreen is just another among many undocumented features. M$ likes to keep developers in the dark. For instance WM 2003 and up have an API called SHLoadImage which can load bmp, gif, jpg and some other formats and return HBITMAP which all the usual GDI functions use.

This API was undocumented until WM 5 came out and even then they said it only works for gif...
[Windows Mobile Development and Hacking General] 3waygeek:
The return value indicates whether or not the standard dialog handler (which calls your OnInitDialog) should handle setting the focus. As a rule, OnInitDialog should return TRUE, unless you change the focus within the handler (or you're doing an OCX property page on big Windows).

I haven't done much WinMob/CE development -- I've been doing big Windows for 15+ years, so window message handling is pretty much second nature. I started doing Windows development back in the days when you didn't have C++ or MFC boilerplate; you had to implement your own DialogProc, crack the messages yourself, etc. It's a lot easier now.
[Windows Mobile Development and Hacking General] hanmin:
CommandBar / MenuBar

I'm back.. with more questions :D

Not much of a major issue, but rather an annoying thing I've found. Probably that's what evc/mfc/m$ intended to do that.

Anyway, I'm starting my way of getting around CommandBar. I created a MFC skeleton, studied the code, and that's what I've found, after I've created a CommandBar/MenuBar on evc and putting it in

if(!m_mainMenuBar.Create(this) ||
!m_mainMenuBar.InsertMenuBar(IDR_MAINMENUBAR) ||
!m_mainMenuBar.AddAdornments() ||
!m_mainMenuBar.LoadToolBar(IDR_MAINMENUBAR))
{
TRACE0("Failed to create IDR_MAINMENUBAR\n");
return -1; // fail to create
}

where I have the variable 'CCeCommandBar m_mainMenuBar' and I have created a MenuBar on evc with the Id 'IDR_MAINMENUBAR'. The menu bar works flawlessly on my dialog based application, when I have the 1st level as a pop up. Example

MenuBar --> 'File' --> 'New', 'Save'

Where 'File' is a folder-like thing that pop-ups and show the contents (i.e. in this example, 'New', and 'Save'). However, given the SAME code to load the CommandBar/MenuBar, it will not work, if I were to put the actual command at 1st level. Example, this will not work

MenuBar -> 'New', 'Save'

where there isn't any folder-like pop-up to store the commands 'New', and 'Save'.

I know that I can have buttons for these commands, and probably works. But, what I'm trying to do is to utilize the bottom-left-right softkey in WM5/6. If I were to have the 'File'->'New','Save' structure, it works fine with WM5, showing it as a softkey. But, if I were to do just 'New','Save' it will not show up in both WM2003 emulator and WM5.

As a matter of fact, even if I have (say) File->New,Load, and I added a new command (i.e. not folder-like-pop-up), example 'Help' on the CommandBar/MenuBar, the File->New,Load will not show up too. It seems like the 1st level command (ie. without a folder-pop-up), causes some problems and stop it from loading further.

Guys, ring any bell?
[Windows Mobile Development and Hacking General] ms64o:
two bytes more

I know it is a bit late! But there is a mistake the code snippet:

HLOCAL clipbuffer = LocalAlloc(0, test.GetLength() * 2); //remember: every letter 2 bytes long!

needs to be

HLOCAL clipbuffer = LocalAlloc(0, test.GetLength() * 2+2);

the terminating 0 is als 2 bytes long!

Those errors are sometimes fatal, with very less chance to find them!

ms64o
[HTC Desire 610] porozex:
some users like me have this problem so after some investigation i found a temporary fix ( im still trying to get rid of it permanently).

so for now:

from phone go settings>developer settings>advanced and there disable hw overlay and enable gpu rendering, done :D

its temporary because hw overlay dosent stick after a reboot.
[HTC Desire 610] ibrahimerik:
I've tried it but i have the same problem.. :(
[HTC Desire 610] porozex:
It fixes it only for 2d apps, I'm trying to get rid of it permanently but for now no success
[Nexus Player Q&A, Help & Troubleshooting] xi Slick ix:
So I know the Nexus Player has an atom processor, so its running some form of Android x86. I have an Asus Chromebox, which I have previously loaded up with Android x86 in the past. Does anyone know if there is a way to get the Android TV interface on generic Android x86, or is Google doing something different here (and not entirely open sourced)? I am pretty interesting in trying to get the Android TV experience on the Chromebox to see how well that works.

-If this should be in one of the dev areas please feel free to point me in that direction.
[Nexus Player Q&A, Help & Troubleshooting] koperniczx3:
It is (kinda) possible.

You need to be running Android 5.0+ already and then the Leanback Launcher can be installed (it's working on my Nexus 5 and on my oDroid C1 running 5.1)

Be aware that it's not a perfect solution
[Nexus Player Q&A, Help & Troubleshooting] xi Slick ix:
Thanks for the tip.

In your case, on an oDroid, you'll still be running an arm variant of android. When you say its not perfect, what exactly isn't working?

I've read on the android x86 project's forum that video playback is an issue on Android 5.0 and up, as recently as May of this year. Need to find some more recent threads regarding that, and determine how well supported Intel's graphic drivers are in Android. I know the Nexus Player is using a 3rd party gpu.

Separately, just so I understand, is Android TV just essentially stock Android with the leanback UI and Launcher?
[Galaxy Tab 10.1 Q&A, Help & Troubleshooting] MadBigMadBoatMan:
Hello! Although I've been using the forum and it's abundance of resources for years, this is my first post.

Feel free to correct me if you find any of my activity to be in conflict with forum rules or etiquette.

I've rooted my SM-T530 and flashed latest versions of both cwm and twrp recovery through ODIN, but I have the classic problem of only being able to boot into stock android recovery.

What I've tried so far:

Rebooting into recovery from ROM Manager (proper recovery version selected in options prior to rebooting, but failing with both cwm and twrp)

Booting into recovery mode with hardware buttons (Power+volume down and power+home+volume up)

Flashing recovery without reboot option checked in ODIN, hardware button rebooting, still goes into stock recovery

There is a method being reported as successful on other devices, but it involves dislocating the battery, and I can't do that on the T530 as it's got a non removable back cover.

Still, other people have flashed custom roms on this device, so it must be possible to do somehow.

If people are willing to guide me, I am willing to go through every step again and post results here, so that other users might find help in the thread if we ever work it out.

EDIT - Solved this issue flashing twrp recovery with Rashr (Play Store Link)
[One (M8) Q&A, Help & Troubleshooting] snehal2671:
I recently got an OTA update and since then my phone has been on a boot loop, when the phone starts every time it says "Android is updating.." then takes me to the home screen and within 10 secs the phone reboots.

This has been happening from last 2 days and I cant seem to find any solution to this.

The phone has 100% official status, only developer options turned on with the USB debugging on, which has been on for last couple of months I guess.

When I get to Recovery at the bottom it shows this error messages:

E:missing bitmap oem_unlock_bg

(Code -1)

E:missing bitmap oem_unlock_bg_yes

(Code -1)

E:missing bitmap oem_unlock_bg_no

(Code -1)

Write host_mode success

handle_cota_install: No CW files. Skip cw installation.

I even tried factory resetting the phone, but still no luck. My data still won't get erased and the phone lock pattern is intact.

The HBOOT screen looks like this:

**** Software status: official***

*** LOCKED ***

M8_UL PVT SHIP S-ON

HBOOT-3.19.0.0000

RADIO-1.25.214500021.06G

OpenDSP-v48.2.2-00564-M8974_F0.1211

OS-4.16.401.13

eMMC-boot 2048MB

Aug 4 2015,19:21:49.0

Can anyone please suggest how to get rid of this issue.

Thanks in advance,
[One (M8) Q&A, Help & Troubleshooting] snehal2671:
I also tried to unlock the bootloader and followed exact instructions given on http://www.htcdev.com/bootloader/unlock-instructions but they don't seem to work and also doesn't reset my phone to factory setting.
[One (M8) Q&A, Help & Troubleshooting] Anakha56:
You are lucky. Mine is stuck on a black screen... :/
[One (M8) Q&A, Help & Troubleshooting] YEK1907:
Did you solve this issue ?
[G2 Q&A, Help & Troubleshooting] beauvafr:
Notifications on locked screen are not shown and a message Unlock to show private info or something is written..

How can I show the full text ?
[G2 Q&A, Help & Troubleshooting] audit13:
When you set the lock screen, are you prompted to select what notifications are shown?
[Redmi Note 2 Q&A, Help & Troubleshooting] Okluzhion:
When I connect my Note 2, it's not seen by the PC. When I list the devices, nothing's there. I tried adding vendor and model ids in udev (I'm on Linux), but it didn't help. Anyone knows how to fix this?
[Redmi Note 2 Q&A, Help & Troubleshooting] I.nfraR.ed:
Update your adb.

You need 1.0.32

First check if your version is older (e.g. 1.0.31):

$ adb version
Android Debug Bridge version 1.0.32

Then upgrade, following #3 from this guide: Ubuntu 14.04 - Install Android Tools
[Redmi Note 2 Q&A, Help & Troubleshooting] Okluzhion:
Tried on a Windows PC and I get the same result, adb version 1.0.32. However, I was able to flash TWRP before, but now it doesn't see the device at all. I'm on xiaomi.eu dev 5.9.24.

Edit: Just realized that this happens on Windows:

Apparently, the drivers are not installed, however I DID install adb drivers, but whenever I try to install Xiaomi USB drivers (manual installation through Device Manager), Windows say they didn't find any compatible drivers for my device. But they ARE there in the folder specified. This is driving me crazy.

Edit edit: found solution for adb drivers problem here, however, I still cannot install drivers for "Redmi".

Anyway, adb works now on this Windows machine, the question is whether I'll be able to achieve this on my Linux PC, too.
[Redmi Note 2 Q&A, Help & Troubleshooting] qetuR:
Thanks a lot! Worked perfectly.
[Galaxy Note 4 Q&A, Help & Troubleshooting] grymmy:
hey peeps, good day/night

I'll start by pleading with you guys to please not bash me for asking this...:fingers-crossed:

I'm interested in purchasing a Note 4 (910F) variant, but, i would like some advice please.

1) which is the "best" model to get in terms of modding/custom roms? I would like to get the variant that has the most custom roms available.

2) can other Note 4 custom rom/s from other snapdragon model/s work on other Note 4 snapdragon variants (compatibility of note 4 roms across other note 4 variants with same chipset)? e.g. 910F and 910S an so on...

3) Please feel free to enlighten me with any other tips/advice guys

many thanks in advance

Ronald
[Galaxy Note 4 Q&A, Help & Troubleshooting] Zionator:
there are only 3 versions that i know of. snapdragon, exynos and note edge and snapdragon has the most roms. at the moment only exynos has a note 5 rom port but some developers are working on port of note 5 rom for snapdragon. the note edge has the same hardware as the note 4 but i am not sure if its the snapdragon or exynos nor do i know how many roms are out for it.

I personally think majority have the snapdragon and therefore most mods and roms are available for snapdragon "910f"
[AT&T Samsung Galaxy Note 4] eyesofice:
Unit Model: SM-N910A

Lock Provided: at&t

UNLOCK INSTRUCTIONS:

Micro-USB cable:

1. Phone must be powered on.

2. Type *#0808# and select 'DM+MODEM+ADB'.

3. Type *#9090# and choose 'DM/DUN over HSIC'.

4. Reboot phone.

5. Connect USB cable, install drivers if needed.

6. Select Samsung diagnostic port in port settings.

7. Press 'Unlock' button for direct unlock.
[AT&T Samsung Galaxy Note 4] eyesofice:
https://usc-flechamobile.netdna-ssl...910A-Unlock-and-repair-by-cable-Manual-en.pdf
[AT&T Samsung Galaxy Note 4] floatingtrees:
There's a lot of threads on here about people doing what you're about to do and bricking their phones, don't test it
[AT&T Samsung Galaxy Note 4] eyesofice:
ya i wanted to make sure that was the same method
[AT&T Samsung Galaxy Note 4] eyesofice:
so doing the research the reason why is its not a code sequence to be dome on its own you have to have a z3x box and the s.e to go with it to complete the process of unlocking the device.
[AT&T Samsung Galaxy Note 4] rclar144:
Does this work??
[AT&T Samsung Galaxy Note 4] eyesofice:
that is the way to do it BUT!!! i recommend having someone else do it if you are not sure what you are doing. I found someone on ebay and paid them 8 bucks to do it for me and he remoted into my pc and did it in 10 mins
[G4 General] alamo76:
Not sure if this has been posted yet, but this is DXOMARK's take on the G4, which places it 2nd in the camera biz. With all that's been said here (and some other independent reviews) - subjective as they are - it's surprising to find it behind the S6 Edge; also interesting to see the Moto X Style with the same score. The G4's time in the limelight seems short-lived.

http://www.dxomark.com/Mobiles/LG-G4-Mobile-review-A-new-contender-in-the-top-3
[G4 General] dondavis007:
Problem with studioreviews is that real life often is different. I have less blur taking pics of my kids with the S6. In my world an equal quality camera with way faster software is a plus. That said I really like the G4 camera software, I just would love to have a but more zsl.

Skickat från min LG-H815 via Tapatalk
[G4 General] Stories:
Not bad
[G4 General] Kemby13:
+1

That being said, i will just c/p what i wrote on gsm arena...

"I believe these dx0 mark tests are trust worthy and professional (in a way...), but one thing

i don't get. -That is the fact that they didn't use any manual settings at all. I mean why the hell not?

It is by far the only thing that separates G4 from all the other phones. They left out the only thing

that could've made any difference in the final score... I really don't get that, someone pls explain it to me,

i must be an idiot -_- ... If they are such professionals, i believe they should use every and any feature a phone

has to get the highest score possible in the end, because those features are the things that separate them from one another...

I rest my case."

All in all, not a bad score - but not what i expected either...
[G4 General] Furma:
is it tho? more and more phones have detailed manual settings including S6, HTC M9, Lumia 930, ...