I'm currently building a native app on Tizen latest SDK and it needs to be programmed in C language.
In my app I need to build a kind of "alarm clock" that will go off in a certain time and if the device is asleep my app will need to woke it up. I can do this already but my app is not shown in the lock screen. I want to know if you guys have any idea of how I can wake up the screen AND make my app ui's go overlapping the lock screen natively and in using the new SDK that it is C based.
Thank you!
For starters, Tizen Native API is in C++, not C.
As for your question, on https://developer.tizen.org/ you can find examples:
how to show popup on locked screen:
Popup pPopup = new (std::nothrow) Popup();
pPopup->Construct(true, Dimension(600, 750));
if (Tizen::Shell::LockManager::GetInstance()->IsLocked())
{
// 'http://tizen.org/privilege/uimanager' platform privilege required
pPopup->SetZOrderGroup(WINDOW_Z_ORDER_GROUP_HIGHEST);
}
how to unlock screen:
if (Tizen::Shell::LockManager::GetInstance()->IsLocked())
{
// 'http://tizen.org/privilege/lockmanager' platform privilege required
Tizen::Shell::LockManager::GetInstance()->Unlock();
UiApp::GetInstance()->GetFrameAt(0)->SetZOrderGroup(WINDOW_Z_ORDER_GROUP_NORMAL);
}
Related
I have been working on an app in Visual Studio 2015 (C++). It's a kiosk app for my school's tech support. Basically, it's a support site that will run in a kiosk. I need to figure out how to lock windows so it only runs that program. It would also be helpful to run the program in fullscreen mode. Keep in mind that all of the kiosks run Windows 7.
Set registry key
HKCU SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
Shell="c:\path\to\whatever.exe"
Disallow task manager via security of taskmgr.exe (add a deny read + deny execute to the binary)
Set autologn:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
DefaultUserName = whatever
DefaultPassword = whatever
Have a boot disk handy. The only way to reverse this is to boot the boot disk and undo one of the steps after mounting the appropriate hive.
you can create your program with main window in full screen mode and popup:
hWnd = CreateWindowEx(WS_EX_CLIENTEDGE|WS_EX_APPWINDOW|WS_EX_TOPMOST,
lpClsName,
"MDI Project under Visual C++ WINAPI",
WS_BORDER|WS_POPUP,
...);// add the remaining parameters
and find taskmgr.exe and hide it and start menu button and hide them also:
hTaskBar = ::FindWindow ("Shell_TrayWnd", "");
hStart = ::FindWindowEx(GetDesktopWindow(), NULL, "Button", "Start");
ShowWindow(hTaskBar, SW_HIDE);
ShowWindow(hStart, SW_HIDE);
so your program looks like easycafe or handycafe
I actually switched from C++ to C#, so I'm gonna explain my answer with C#.
I used a keyboard hook library to capture keyboard input and block all non-letter/number input so alt-f4, alt-tab etc. would not work. I then determined a closing sequence of characters using another keyboard hook (LWin+C+Home+F12+PrtSc).
As for Ctrl-Alt-Del, that cannot be disabled (as far as I know) because it is a system function, so I just left that as it is.
I also got the bounds of the screen and set the size of the window to the maximum screen size at application launch, as well as whenever the app is resized or moved. This essentially makes it so the app covers the task bar, and the bar with the close and minimize buttons is also covered, but if someone found a way to move it it would immediately go back to it's full size.
I also set up autologin as was detailed in a previous answer, but I just didn't do it through code.
I'm trying to prevent the app from being closed by clicking the Close box on the App Window.
For example, having a text editor with unsaved changes, upon pressing Close Box, I would first display, "Do you want to save changes before exiting?"
How can I detect app wanting to close and prevent that from happening?
I'm using C++, and this needs to be for Windows 10 Universal Apps UWP.
I already know how to do this for Win32.
The comments are correct. There is currently no way for a regular Store app to do this.
However, with the Creators Update (and corresponding SDK) we have included a preview API that you can now check out for this functionality:
The Windows.UI.Core.Preview.SystemNavigationManagerPreview class provides a CloseRequested event that an app can mark as handled. For the event to work the app will need to declare the restricted 'confirmAppClose' capability per:
https://learn.microsoft.com/en-us/windows/uwp/packaging/app-capability-declarations
Please let us know your feedback.
Thanks,
Stefan Wick - Windows Developer Platform
I've been working on a project that will need a notifier in the system tray (sorry, "System Notification Area"). It will be a simple app that just generates popup notifications when it receives a message via a Zeromq socket.
I am not having any luck finding anything other than .NET resources and examples. Does anyone have a sample in C/C++?
I would start with this section of MSDN: Notifications and the Notification Area.
Then I'd check the NotificationIcon Sample in the Windows SDK.
What framework are you using? There should probably be several implementations for MFC, but there might different implementation for WTL and other frameworks. If you want to use the Windows API with no object orientation - well, you won't need any wrapper library then, but you can look at these libraries for example.
Here's one that has MFC and non-MFC version from CodeProject:
http://www.codeproject.com/KB/shell/systemtray.aspx
What you want here is probably ShowBalloon() function, which shows a balloon notification, but I'm pretty sure you must create a tray icon for that (can't have a notification balloon without having a tray icon).
I'm trying to make a Windows app that checks some things in the background, and inform the user via a systray icon.
The app is made with Not managed C++ and there is no option to switch to .net or Java.
If the user wants to stop the app, he will use the tray icon.
The app can't be a Service because of the systray side and because it must run without installing anything on the user computer ( it's a single .exe )
Using the typical Win32 program structure ( RegisterClass, WndProc and so on ) i dont know how can i place some code to run apart the window message loop.
Maybe i have to use CreateProcess() or CreateThread()? Is It the correct way to handle the Multithreading environment?
If i have to use CreateProcess()/CreateThread(), how can i comunicate between the two threads?
Thanks ;)
As for the system tray icon, you'll need Shell_NotifyIcon.
See http://msdn.microsoft.com/en-us/library/bb762159.aspx
I doubt you want to create new processes to do this, you want to create a thread in your application. The API to do this is CreateThread. But if you are using C++, you should really be investigating the use of frameworks and class libraries to do this, not writing what will effectively be C code from scratch.
All threads belonging to an application share the global variables of the application, which can thus be used for communication. You will need to protect such multi-threaded access with something like a critical section.
I have a CView which I would like to host a DirectShow renderer.
I did not write the original code, I am simply cleaning up and moving the code to VS2005. This necessitated an upgrade of certain third party tools and so I'm trying to change the code a bit without having a full understanding of DX/DirectShow.
The problem is that my app hangs when I run
hr = gcap.pFg->QueryInterface(IID_IVideoWindow, (void **)&gcap.pVW);
[trimmed some code]
gcap.pVW->put_Owner((OAHWND) m_pDockWnd->GetSafeHwnd()); // We own the window now
m_pDockWnd is the CView. I can do this when in preview mode, but not when in capture mode. In capture mode, it hangs the app.
If I don't own the render window, there is no problem (although the capture window is owned by the desktop, which won't work for me).
Also, the capture window shows a busy cursor when it is owned by the desktop--probably it's actually not working then either, but it's at least not hanging the app. By hang I mean that the app does not respond to user input, but background threads continue to run.
Update: We were using an old version of DirectX (Aug '06). I compiled/linked against the DirectShow stuff packaged with the Vista SDK and .... no dice.
I've got a resolution for this.
The video stream as getting started from a thread without a message pump, this was causing the video window to become non-responsive. (I guess XP was more tolerant of this, maybe the new display driver model in Vista mucked it up.) Anyways, once I did a SendMessage to the main app window and started the video capture from there, everything seems to work!