|
yes,i have one win32 diallogbox with one browser custum control. i am calling this dialog from dll.it is working fine.i taring to disable right click of web browser control.
|
|
|
|
|
|
Hi,
How can i retain the text color while highlighting a particular row in Clist control
I am using a derived Clist control where already draw item is overridden in the name of OnNMCustomdraw (OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult))
|
|
|
|
|
The colors set in a custom draw handler for CListCtrl s are ignored for selected and hot items. With classic styles, the system uses COLOR_HIGHLIGHTTEXT for selected items. If you want to use other colors for selected and hot items, you must draw the items yourself and set the custom draw handler result to CDRF_SKIPDEFAULT :
void CMyListCtrl::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult)
{
*pResult = CDRF_DODEFAULT;
LPNMLVCUSTOMDRAW lplvcd = reinterpret_cast<LPNMLVCUSTOMDRAW>(pNMHDR);
switch (lplvcd->nmcd.dwDrawStage)
{
case CDDS_PREPAINT : *pResult = CDRF_NOTIFYITEMDRAW; break;
case CDDS_ITEMPREPAINT : *pResult = CDRF_NOTIFYSUBITEMDRAW; break;
case CDDS_ITEMPREPAINT | CDDS_SUBITEM : if (IsSelected(lplvcd->nmcd.dwItemSpec))
{
DrawCell(lplvcd, COLOR_HIGHLIGHTTEXT);
*pResult = CDRF_SKIPDEFAULT; }
else
{
}
break;
}
}
This example is for a report style list control.
|
|
|
|
|
how to build application for x86 on visual studio 2003
|
|
|
|
|
As opposed to what? Normally F7 will build whatever application you have created.
Have you tried this forum?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
x86 is usually the default... so just build it and it should work on x86. if you have to do something for x64, then you usually have to use the 64-bit compiler (which is included but not the default).
|
|
|
|
|
Hello Friends
I am trying to connect to USB Printer.For that i m using Setup Calls but SetupDiEnumDeviceInterfaces is returning FALSE . Here is the Code that i m using to get DevicePath:
#define CLSID_STR_WEIUSB (L"{4d36e979-e325-11ce-bfc1-08002be10318}")
int main(int argc, char* argv[])
{
GUID DevClass; HDEVINFO hDevInfoSet; DWORD dwIndex; DWORD dwRequired; DWORD dwError; BOOL bResult;
SP_DEVICE_INTERFACE_DATA DevNode;
PSP_DEVICE_INTERFACE_DETAIL_DATA DevDetails;
CLSIDFromString(CLSID_STR_WEIUSB, &DevClass);
hDevInfoSet = SetupDiGetClassDevs(
&DevClass, NULL, NULL, DIGCF_ALLCLASSES);
if (hDevInfoSet == INVALID_HANDLE_VALUE)
{
fprintf(stderr,
"Unable to create device information set (Error 0x%08X)\n",
GetLastError());
return 1;
}
printf("Successfully created device information set.\n");
for (dwIndex = 0; ; dwIndex++)
{
DevNode.cbSize = sizeof(DevNode);
bResult = SetupDiEnumDeviceInterfaces(
hDevInfoSet, NULL, &DevClass, dwIndex, &DevNode);
if (!bResult)
{
dwError = GetLastError();
if (dwError != ERROR_NO_MORE_ITEMS)
{
fprintf(stderr,
"Error enumerating devices (0x%08X).\n",
dwError);
}
break;
}
SetupDiGetDeviceInterfaceDetail(
hDevInfoSet, &DevNode, NULL, 0, &dwRequired, NULL);
DevDetails = (PSP_DEVICE_INTERFACE_DETAIL_DATA)malloc(dwRequired);
if (DevDetails == NULL)
{
fprintf(stderr,
"Unable to allocate memory for buffer. Stopping.\n");
break;
}
memset(DevDetails, 0, dwRequired);
DevDetails->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);
bResult = SetupDiGetDeviceInterfaceDetail(
hDevInfoSet, &DevNode, DevDetails, dwRequired, &dwRequired, NULL);
if (!bResult)
{
fprintf(stderr,
"ERROR: Unable to retrieve device path (0x%08X).\n",
GetLastError());
}
else
{
printf(" %s\n", DevDetails->DevicePath);
}
free(DevDetails);
} getchar();
return 0;
}
Class GUID, I extract it manually from registery. After that in fn SetupDiGetClassDevs,I tried DIGCF_ALLCLASSES or DIGCF_DEVICEINTERFACE + DIGCF_PRESENT.
But main prob ,m facing that after When I am calling SetupDiEnumDeviceInterfaces which is returning False.
Any ideas?
Regards
Yogesh
|
|
|
|
|
Hey Guys
I tried by passing
{A5DCBF10-6530-11D2-901F-00C04FB951ED} this GUID and It returns me all USB' devicePath. but how can I differentiate for Printer?
Any Ideas ?
Thanks in Advance.
|
|
|
|
|
There's a call (can't remember off the top of my head) that gives you more descriptive information based on the device ID (which you should be able to extract from the information above).
|
|
|
|
|
Thanks A Lot For Reply.
I got the printer by matching Product Id And Vendor ID.
Y
|
|
|
|
|
I am trying to find Volume control in c/c++/visualc++ for windows7?? Any suggesions please help me.
|
|
|
|
|
Are you both from the same school??
Check the answer here
|
|
|
|
|
In C/C++ on windows vista/7 how to get master volume or how to change master volume programmatically in C++/VC++?
Please give a detailed reply beacuse i am new to VC++
Thanks in advance...
|
|
|
|
|
A simple google search with above question results many samples...
here is the one [^] and the rest[^]
|
|
|
|
|
See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
i am calling win32 dialogbox from dll using dialogbox() method
but it behaves like modeless dialog how can solve this problem and how can initialize maximise dialogbox in win32
|
|
|
|
|
|
Why do you say that it behaves like a modeless dialog?
Are you able to switch back to the parent dialog when the modal dialog is shown?
|
|
|
|
|
i am calling that dialogbox from windows7 login screen by clicking one tile image .then it displays .but if i click out side the dialog then it goes to back.i don't want that please help me i past code
HRESULT PasswordResetCredential::SetSelected(BOOL* pbAutoLogon)
{
*pbAutoLogon = FALSE;
//Ilantus
fetchPortalURL((WCHAR)"");
return S_FALSE;
}
void fetchPortalURL(WCHAR username) {
DialogBox((HINSTANCE)g_hinst, MAKEINTRESOURCE(IDD_DIALOG1),NULL, InputBox_WndProc);
}
|
|
|
|
|
The third parameter which is the parent is given as NULL.
Set the parent to the desired window to make it modal.
|
|
|
|
|
hi,
santosh thanks for reply .how to do that.please guide me.
|
|
|
|
|
santosh
i set that parent windo it is not working.
thanks
venkatesh
|
|
|
|
|
|
hi ,
please check this code;
Thanks
venkatesh
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) 2012 Ilantus Technologies Pvt. Ltd.. All rights reserved.
//
//
#ifndef WIN32_NO_STATUS
#include <ntstatus.h>
#define WIN32_NO_STATUS
#endif
#include <tchar.h>
#include "PasswordResetCredential.h"
#include "guid.h"
#include "resource.h"
// Added by Suren & Gopi
#include <windows.h>
#include <winreg.h>
#include <stdio.h>
#include <exdisp.h>
#include "ax.h"
extern HINSTANCE hInstance;
typedef int (WINAPI * PFRUNGATEFRAMEWORKPWDRESET) (HWND, PWSTR, PWSTR, PWSTR);
// PasswordResetCredential ////////////////////////////////////////////////////////
//venkat
//HMODULE hInst;
char IB_res[10];
double defaultValue = 0;
HWND hwebf;
bool loaded, has_clicked, isquit=false;
INT_PTR CALLBACK InputBox_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_INITDIALOG:
{
char url[1024] = {0};//venkat come
HKEY keyHandle = 0;
DWORD size = sizeof(url);
DWORD type=0;
/////////
ShowWindow(hwnd,SW_SHOWMAXIMIZED);
HWND hk = GetDlgItem(hwnd,IDC_CUSTOM1);
RECT rc = {0};
GetClientRect(hwnd,&rc);
SetWindowPos(hk,0,0,0,rc.right,rc.bottom,SWP_SHOWWINDOW);
//HINSTANCE hInstance1;
// HICON hIcon;
//hIcon =(HICON)LoadImage( hInstance1,
// MAKEINTRESOURCE(IDI_ICON1),
// IMAGE_ICON,
// GetSystemMetrics(SM_CXSMICON),
// GetSystemMetrics(SM_CYSMICON),
// 0);
// if(hIcon)
// {
// SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
// }
/////////
HWND hX = GetDlgItem(hwnd,IDC_CUSTOM1);
SendMessage(hX,AX_INPLACE,1,0);
LONG ret = RegOpenKey(HKEY_LOCAL_MACHINE,L"SOFTWARE\\Ilantus\\PMP", &keyHandle);
if(ret == ERROR_SUCCESS)
{
RegQueryValueEx( keyHandle, L"url", 0, &type, (BYTE*)url, &size);
}
RegCloseKey(keyHandle);
IWebBrowser2* wb = 0;
SendMessage(hX,AX_QUERYINTERFACE,(WPARAM)&IID_IWebBrowser2,(LPARAM)&wb);
if (wb)
{
wb->Navigate((BSTR)url,0,0,0,0);
wb->Release();
}
return TRUE;
}
//case WM_RBUTTONDBLCLK:
// {
// ShowWindow(hwnd,SW_SHOWMAXIMIZED);
// return TRUE;
// }
case WM_LBUTTONDBLCLK:
{
ShowWindow(hwnd,SW_SHOWMAXIMIZED);
return TRUE;
}
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDOK:
/* if (!GetDlgItemText(hwnd, IDC_EDIT, IB_res, 10))
*IB_res = 0;*/
case IDCANCEL:
EndDialog(hwnd, wParam);
break;
}
break;
default:
return FALSE;
}
return TRUE;
}
//HINSTANCE hInstance;
HWND hwndParent;
/////////venkat
PasswordResetCredential::PasswordResetCredential():
_cRef(1),
_pCredProvCredentialEvents(NULL)
{
DllAddRef();
ZeroMemory(_rgCredProvFieldDescriptors, sizeof(_rgCredProvFieldDescriptors));
ZeroMemory(_rgFieldStatePairs, sizeof(_rgFieldStatePairs));
ZeroMemory(_rgFieldStrings, sizeof(_rgFieldStrings));
}
PasswordResetCredential::~PasswordResetCredential()
{
for (int i = 0; i < ARRAYSIZE(_rgFieldStrings); i++)
{
CoTaskMemFree(_rgFieldStrings[i]);
CoTaskMemFree(_rgCredProvFieldDescriptors[i].pszLabel);
}
DllRelease();
}
// Initializes one credential with the field information passed in.
// Set the value of the SFI_FIMTITLE field to pwzUsername.
// Optionally takes a password for the SetSerialization case.
HRESULT PasswordResetCredential::Initialize(
const CREDENTIAL_PROVIDER_FIELD_DESCRIPTOR* rgcpfd,
const FIELD_STATE_PAIR* rgfsp,
PCWSTR pwzUsername,
PCWSTR pwzPassword
)
{
UNREFERENCED_PARAMETER(pwzPassword);
HRESULT hr = S_OK;
// Copy the field descriptors for each field. This is useful if you want to vary the
// field descriptors based on what Usage scenario the credential was created for.
for (DWORD i = 0; SUCCEEDED(hr) && i < ARRAYSIZE(_rgCredProvFieldDescriptors); i++)
{
_rgFieldStatePairs[i] = rgfsp[i];
hr = FieldDescriptorCopy(rgcpfd[i], &_rgCredProvFieldDescriptors[i]);
}
// Initialize the String values of all the fields.
if (SUCCEEDED(hr))
{
hr = SHStrDupW(L"Forgot Password", &_rgFieldStrings[SFI_FIMTITLE]);
}
if (SUCCEEDED(hr))
{
hr = SHStrDupW(pwzUsername ? pwzUsername : L"", &_rgFieldStrings[SFI_USERNAME]);
}
if (SUCCEEDED(hr))
{
hr = SHStrDupW(L"Submit", &_rgFieldStrings[SFI_SUBMIT_BUTTON]);
}
if (SUCCEEDED(hr))
{
hr = SHStrDupW(L"e.g. ilantususer", &_rgFieldStrings[SFI_SAMPLE]);
}
return S_OK;
}
// LogonUI calls this in order to give us a callback in case we need to notify it of anything.
HRESULT PasswordResetCredential::Advise(
ICredentialProviderCredentialEvents* pcpce
)
{
if (_pCredProvCredentialEvents != NULL)
{
_pCredProvCredentialEvents->Release();
}
_pCredProvCredentialEvents = pcpce;
_pCredProvCredentialEvents->AddRef();
return S_OK;
}
// LogonUI calls this to tell us to release the callback.
HRESULT PasswordResetCredential::UnAdvise()
{
if (_pCredProvCredentialEvents)
{
_pCredProvCredentialEvents->Release();
}
_pCredProvCredentialEvents = NULL;
return S_OK;
}
void fetchPortalURL(WCHAR username) {
//char url[1024] = {0};//venkat come
// HKEY keyHandle = 0;
//DWORD size = sizeof(url);
//DWORD type=0;
//
//LONG ret = RegOpenKey(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Ilantus\\PMP", &keyHandle);
//if(ret == ERROR_SUCCESS)
//{
// RegQueryValueEx( keyHandle, L"url", 0, &type, (BYTE*)url, &size);
//}
//RegCloseKey(keyHandle);
////venkat
//MessageBox(NULL,NULL,L"hi23",MB_SYSTEMMODAL|MB_ICONINFORMATION);
OleInitialize(0);
if (!AXRegister())
DialogBox((HINSTANCE)g_hinst, MAKEINTRESOURCE(IDD_DIALOG1),NULL, InputBox_WndProc);
////venkat
//MessageBox(NULL, (LPCWSTR)url, L"Ilantus PMP URL", MB_SYSTEMMODAL|MB_ICONINFORMATION);
//system(( " c:\\progra~1\\intern~1\\iexplore.exe www.google.co.in"));
//HINSTANCE hInstance = ShellExecute(NULL, L"open", (LPCWSTR)url, NULL, NULL, SW_MAXIMIZE);
}
// LogonUI calls this function when our tile is selected (zoomed).
// If you simply want fields to show/hide based on the selected state,
// there's no need to do anything here - you can set that up in the
// field definitions. But if you want to do something
// more complicated, like change the contents of a field when the tile is
// selected, you would do it here.
HRESULT PasswordResetCredential::SetSelected(BOOL* pbAutoLogon)
{
*pbAutoLogon = FALSE;
//Ilantus
fetchPortalURL((WCHAR)"");
return S_FALSE;
}
// Similarly to SetSelected, LogonUI calls this when your tile was selected
// and now no longer is. The most common thing to do here (which we do below)
// is to clear out the password field.
HRESULT PasswordResetCredential::SetDeselected()
{
HRESULT hr = S_OK;
if (_rgFieldStrings[SFI_USERNAME])
{
//CoTaskMemFree(_rgFieldStrings[SFI_USERNAME]);
hr = wcscpy_s(_rgFieldStrings[SFI_USERNAME], wcslen(L"") + 1, L"");
if (SUCCEEDED(hr) && _pCredProvCredentialEvents)
{
_pCredProvCredentialEvents->SetFieldString(this, SFI_USERNAME, _rgFieldStrings[SFI_USERNAME]);
}
}
return hr;
}
// Gets info for a particular field of a tile. Called by logonUI to get information to
// display the tile.
HRESULT PasswordResetCredential::GetFieldState(
DWORD dwFieldID,
CREDENTIAL_PROVIDER_FIELD_STATE* pcpfs,
CREDENTIAL_PROVIDER_FIELD_INTERACTIVE_STATE* pcpfis
)
{
HRESULT hr;
// Validate paramters.
if ((dwFieldID < ARRAYSIZE(_rgFieldStatePairs)) && pcpfs && pcpfis)
{
*pcpfs = _rgFieldStatePairs[dwFieldID].cpfs;
*pcpfis = _rgFieldStatePairs[dwFieldID].cpfis;
hr = S_OK;
}
else
{
hr = E_INVALIDARG;
}
return hr;
}
// Sets ppwsz to the string value of the field at the index dwFieldID.
HRESULT PasswordResetCredential::GetStringValue(
DWORD dwFieldID,
PWSTR* ppwsz
)
{
HRESULT hr;
// Check to make sure dwFieldID is a legitimate index.
if (dwFieldID < ARRAYSIZE(_rgCredProvFieldDescriptors) && ppwsz)
{
// Make a copy of the string and return that. The caller
// is responsible for freeing it.
hr = SHStrDupW(_rgFieldStrings[dwFieldID], ppwsz);
}
else
{
hr = E_INVALIDARG;
}
return hr;
}
// Gets the image to show in the user tile.
HRESULT PasswordResetCredential::GetBitmapValue(
DWORD dwFieldID,
HBITMAP* phbmp
)
{
HRESULT hr;
// Validate paramters.
if ((SFI_TILEIMAGE == dwFieldID) && phbmp)
{
HBITMAP hbmp = LoadBitmap(HINST_THISDLL, MAKEINTRESOURCE(IDB_TILE_IMAGE));
if (hbmp != NULL)
{
hr = S_OK;
*phbmp = hbmp;
}
else
{
hr = HRESULT_FROM_WIN32(GetLastError());
}
}
else
{
hr = E_INVALIDARG;
}
return hr;
}
// Sets pdwAdjacentTo to the index of the field the submit button should be
// adjacent to. We recommend that the submit button is placed next to the last
// field which the user is required to enter information in. Optional fields
// should be below the submit button.
HRESULT PasswordResetCredential::GetSubmitButtonValue(
DWORD dwFieldID,
DWORD* pdwAdjacentTo
)
{
HRESULT hr;
// Validate parameters.
if ((SFI_SUBMIT_BUTTON == dwFieldID) && pdwAdjacentTo)
{
// pdwAdjacentTo is a pointer to the fieldID you want the submit
// button to appear next to.
*pdwAdjacentTo = SFI_USERNAME;
hr = S_OK;
}
else
{
hr = E_INVALIDARG;
}
return hr;
}
// Sets the value of a field which can accept a string as a value.
// This is called on each keystroke when a user types into an edit field.
HRESULT PasswordResetCredential::SetStringValue(
DWORD dwFieldID,
PCWSTR pwz
)
{
HRESULT hr;
// Validate parameters.
if (dwFieldID < ARRAYSIZE(_rgCredProvFieldDescriptors) &&
(CPFT_EDIT_TEXT == _rgCredProvFieldDescriptors[dwFieldID].cpft ||
CPFT_PASSWORD_TEXT == _rgCredProvFieldDescriptors[dwFieldID].cpft))
{
PWSTR* ppwszStored = &_rgFieldStrings[dwFieldID];
CoTaskMemFree(*ppwszStored);
hr = SHStrDupW(pwz, ppwszStored);
}
else
{
hr = E_INVALIDARG;
}
return hr;
}
//-------------
// The following methods are for logonUI to get the values of various UI elements and then communicate
// to the credential about what the user did in that field. However, these methods are not implemented
// because our tile doesn't contain these types of UI elements
HRESULT PasswordResetCredential::GetCheckboxValue(
DWORD dwFieldID,
BOOL* pbChecked,
PWSTR* ppwszLabel
)
{
UNREFERENCED_PARAMETER(dwFieldID);
UNREFERENCED_PARAMETER(pbChecked);
UNREFERENCED_PARAMETER(ppwszLabel);
return E_NOTIMPL;
}
HRESULT PasswordResetCredential::GetComboBoxValueCount(
DWORD dwFieldID,
DWORD* pcItems,
DWORD* pdwSelectedItem
)
{
UNREFERENCED_PARAMETER(dwFieldID);
UNREFERENCED_PARAMETER(pcItems);
UNREFERENCED_PARAMETER(pdwSelectedItem);
return E_NOTIMPL;
}
HRESULT PasswordResetCredential::GetComboBoxValueAt(
DWORD dwFieldID,
DWORD dwItem,
PWSTR* ppwszItem
)
{
UNREFERENCED_PARAMETER(dwFieldID);
UNREFERENCED_PARAMETER(dwItem);
UNREFERENCED_PARAMETER(ppwszItem);
return E_NOTIMPL;
}
HRESULT PasswordResetCredential::SetCheckboxValue(
DWORD dwFieldID,
BOOL bChecked
)
{
UNREFERENCED_PARAMETER(dwFieldID);
UNREFERENCED_PARAMETER(bChecked);
return E_NOTIMPL;
}
HRESULT PasswordResetCredential::SetComboBoxSelectedValue(
DWORD dwFieldId,
DWORD dwSelectedItem
)
{
UNREFERENCED_PARAMETER(dwFieldId);
UNREFERENCED_PARAMETER(dwSelectedItem);
return E_NOTIMPL;
}
HRESULT PasswordResetCredential::CommandLinkClicked(DWORD dwFieldID)
{
UNREFERENCED_PARAMETER(dwFieldID);
return E_NOTIMPL;
}
//------ end of methods for controls we don't have in our tile ----//
// Collect the username and password into a serialized credential for the correct usage scenario
// (logon/unlock is what's demonstrated in this sample). LogonUI then passes these credentials
// back to the system to log on.
HRESULT PasswordResetCredential::GetSerialization(
CREDENTIAL_PROVIDER_GET_SERIALIZATION_RESPONSE* pcpgsr,
CREDENTIAL_PROVIDER_CREDENTIAL_SERIALIZATION* pcpcs,
PWSTR* ppwszOptionalStatusText,
CREDENTIAL_PROVIDER_STATUS_ICON* pcpsiOptionalStatusIcon
)
{
UNREFERENCED_PARAMETER(pcpgsr);
UNREFERENCED_PARAMETER(pcpcs);
UNREFERENCED_PARAMETER(ppwszOptionalStatusText);
UNREFERENCED_PARAMETER(pcpsiOptionalStatusIcon);
HWND phwndOwner = NULL;
HMODULE hGateFrameworkDll = NULL;
PFRUNGATEFRAMEWORKPWDRESET pfRunGateFrameworkPwdReset = NULL;
PWSTR domain = NULL;
PWSTR username = NULL;
PWSTR separator = NULL;
PWSTR input_username;
// Get the HWnd of the parent
if (FAILED(_pCredProvCredentialEvents->OnCreatingWindow(&phwndOwner)))
{
phwndOwner = NULL;
}
if (FAILED(SHStrDupW(_rgFieldStrings[SFI_USERNAME], &input_username)))
{
MessageBox(
phwndOwner,
_T("Fail: SHStrDupW(_rgFieldStrings[SFI_USERNAME], &input_username)"),
_T("Error"),
MB_OK | MB_ICONEXCLAMATION | MB_TASKMODAL
);
goto FAIL;
}
if (!input_username || *input_username == '\0')
{
MessageBox(
phwndOwner,
_T("Please input Username"),
_T("Error"),
MB_OK | MB_ICONEXCLAMATION | MB_TASKMODAL
);
goto FAIL;
/////////////////////////////////////////////////////////////////
//DialogBox();
////////////////////////////////////////////////////////////////
}
//if ((separator = wcschr(input_username, '\\')) != NULL)
//{
// // assume input is in the form of domain\username
// *separator = '\0';
// domain = input_username;
// username = separator + 1;
//}
//else if ((separator = wcschr(input_username, '@')) != NULL)
//{
// // assume input is in the form of UPN
// domain = NULL;
// username = input_username;
//}
//else
//{
// MessageBox(
// phwndOwner,
// _T("Please input Domain\\Username or UPN"),
// _T("Error"),
// MB_OK | MB_ICONEXCLAMATION | MB_SYSTEMMODAL
// );
// goto FAIL;
//}
//Ilantus
//fetchPortalURL((WCHAR)username);
//// Load the GateFramework dll
//hGateFrameworkDll = LoadLibrary(GATE_FRAMEWORK_MODULE);
//if (!hGateFrameworkDll)
//{
// MessageBox(
// phwndOwner,
// _T("Fail: LoadLibrary(GATE_FRAMEWORK_MODULE)"),
// _T("Error"),
// MB_OK | MB_ICONEXCLAMATION | MB_SYSTEMMODAL
// );
// goto FAIL;
//}
//pfRunGateFrameworkPwdReset = (PFRUNGATEFRAMEWORKPWDRESET)GetProcAddress(hGateFrameworkDll, "RunPwdReset");
//if (!pfRunGateFrameworkPwdReset)
//{
// MessageBox(
// phwndOwner,
// _T("Fail: GetProcAddress(hGateFrameworkDll, \"RunPwdReset\")"),
// _T("Error"),
// MB_OK | MB_ICONEXCLAMATION | MB_SYSTEMMODAL
// );
// goto FAIL;
//}
//pfRunGateFrameworkPwdReset(phwndOwner, domain, username, L"en-US");
FAIL:
if (input_username)
{
CoTaskMemFree(input_username);
}
if (hGateFrameworkDll)
{
FreeLibrary(hGateFrameworkDll);
}
return E_FAIL;
}
// ReportResult is completely optional. Its purpose is to allow a credential to customize the string
// and the icon displayed in the case of a logon failure. For example, we have chosen to
// customize the error shown in the case of bad username/password and in the case of the account
// being disabled.
HRESULT PasswordResetCredential::ReportResult(
NTSTATUS ntsStatus,
NTSTATUS ntsSubstatus,
PWSTR* ppwszOptionalStatusText,
CREDENTIAL_PROVIDER_STATUS_ICON* pcpsiOptionalStatusIcon
)
{
UNREFERENCED_PARAMETER(ntsStatus);
UNREFERENCED_PARAMETER(ntsSubstatus);
UNREFERENCED_PARAMETER(ppwszOptionalStatusText);
UNREFERENCED_PARAMETER(pcpsiOptionalStatusIcon);
return E_NOTIMPL;
}
|
|
|
|
|